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 :
- how can register multiple classes ?
collectionview.register(flowviewcell.self
- reusable cells system gets crazy because different
- 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
Post a Comment