Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionView column grid gaps

I am using UICollectionView flow layout in my iPad application. I have cells with different width and heights. When I used subclass of UICollectionViewFlowLayout as layout for collection view, it shows me gaps between cells.

If there is large cell in column, it makes grid and small cells of that column get render centered of that large cell in column. Is there any better way to tight cell wrapping?

I am using horizontal scrolling. I tried using layoutAttributesForElementsInRect: method, but didn't get succeed into that.

Please let me know if anyone has done same kind of thing by using layoutAttributesForElementsInRect: method or by other way...

Please find attached image. I need same kind of solutionenter image description here

Thanks in advance...

like image 272
Swapnil Avatar asked Jan 03 '13 10:01

Swapnil


1 Answers

Use like this

UICollectionViewFlowLayout *layout=[[UICollectionViewFlowLayout alloc] init];

layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 2;
like image 152
Nagendra Tripathi Avatar answered Nov 09 '22 23:11

Nagendra Tripathi