ios - UICollectionView with two columns, different cell sizes and one after the other -


this i'm aiming for:

enter image description here

but collection view looks this:

enter image description here

theres kind of separator between different rows. don't need them resize auto layout, it's repeated pattern of 4 cells know exact size of each one.

i'm using

  func collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, sizeforitematindexpath indexpath: nsindexpath) -> cgsize { 

for size of each cell

and flow layout:

let flowlayout = uicollectionviewflowlayout()     flowlayout.scrolldirection = .vertical     flowlayout.minimumlinespacing = 10     flowlayout.minimuminteritemspacing = 5 

how can approach separation?

you cannot using uicollectionviewflowlayout. have subclass uicollectionviewlayout , create own custom collection view layout.

thankfully great guys @ ray wenderlich have done tutorial on how create custom collection view layout mimicks layout of pinterest app. layout trying achieve.

uicollectionview custom layout tutorial: pinterest


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -