swift - Different cell appearance for a single collection view -


i asking here option make collectionview multiple cells since our cells have different appearance different indexs.

the answer not sufficient because other create multiple cells , pick 1 every index, have sorts of problems such :

  1. how can register multiple classes ? collectionview.register(flowviewcell.self
  2. reusable cells system gets crazy because different
  3. every action on cell must identified class , becomes mess.

so, searching way single cell.

what way set different buttons in same position of cell, , show/enable different button different indexes ?

so index 1 have 2 circle buttons, , index 2 have 1 large wide button? if put them on same spot , hide 1 strange design.

the answer linked looking for. use 4 different types of cell in our app , don't have problem it.

you don't have register multiple classes, can create them in storyboard (inside collectionview), system register classes you. , call cells explain in answer.

the hard part having different sizes, have 2 (large cell , square cell, 2 square cells fit on same level), more tricky, different height. apart can have different content on each cell without problem.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -