ios - How to set size of prototype UICollectionViewCell -


i have uicollectionview in ib bunch of different prototype cells.

i have tried give each cell own size in ib when instantiate dequeuereusable..., have size. finding doesn't matter settings in ib cell, collectionview uses own cell size cells used inside it.

is bug? if not best way set custom size cells?

i have tried:

- (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath {      nsstring* cellidentifier = self.cellidentifier;     imagecell* cell =  [collectionview dequeuereusablecellwithreuseidentifier:self.cellidentifier forindexpath:indexpath];      return [cell sizeofcell]; } 

but reason app crashes when dequeuing cells in function.

i have subclassed prototype cells , have function has them return own size. there other way instantiate cell identifier gave in ib?

the sizing of cells (for collection views , table views) in ib layout purposes, has no effect on size @ run time. should implement uicollectionviewdelegateflowlayout method collectionview:layout:sizeforitematindexpath: return correct size each item.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -