Different cell size in UICollectionview

New Jango Tester picture New Jango Tester · Apr 17, 2013 · Viewed 36.5k times · Source

In my iphone app,I am showing images on a collection view. I fetch the images from urls,with urls I get the image size also. eg:- let's say there are two kinds of images landscape and portrait.I get value P for portrait images and L for landscape images

How to customize the collectionView cell's size ?

Answer

Anil Varghese picture Anil Varghese · Apr 17, 2013

Use this UICollectionViewDelegateFlowLayout method

 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;