UICollectionView Self Sizing Cells with Auto Layout

前端 未结 16 1752
野性不改
野性不改 2020-11-22 05:58

I\'m trying to get self sizing UICollectionViewCells working with Auto Layout, but I can\'t seem to get the cells to size themselves to the content. I\'m having

16条回答
  •  有刺的猬
    2020-11-22 06:05

    In addition to above answers,

    Just make sure you set estimatedItemSize property of UICollectionViewFlowLayout to some size and do not implement sizeForItem:atIndexPath delegate method.

    That's it.

提交回复
热议问题