uicollectionviewcell - Two column UICollectionView with header -


i have layout has 2 columns side side. there simple way using single uicollectionview? requirements solution must work ios 8 , cells must stack vertically in each column this:

   -----------------    |             |    |       b       |    -----------------    |   c   |   e   |    |   c   |   f   |    |   d   |       |    |   e   |       |    ----------------- 

the stacked cs demonstrate cells in left , right columns can different heights, it's not enough paint them left, right, left, right.

this pretty straightforward using uicollectionview flow layout. since each cell can have dynamic height, thing need require each cell has width of 160 (or half collection view width). implement collectionview:layout:sizeforitematindexpath: each item can return it's appropriate height.

since each cell has dynamic height though, end 1 column lot longer another. if want equal column heights, you'll want shuffle order of list in such way height first half of items approx height of other half.

enter image description here


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -