Specifying one Dimension of Cells in UICollectionView using Auto Layout

前端 未结 5 1678
执念已碎
执念已碎 2020-11-30 16:01

In iOS 8 the UICollectionViewFlowLayout supports automatically resizing cells based on their own content size. This resizes the cells in both width and height a

5条回答
  •  天涯浪人
    2020-11-30 16:53

    YES it can be done using auto layout programmatically and by setting constraints in storyboard or xib. You need to add constraint for width size to remain constant and set height greater than or equal to.
    http://www.thinkandbuild.it/learn-to-love-auto-layout-programmatically/

    http://www.cocoanetics.com/2013/08/variable-sized-items-in-uicollectionview/
    Hope this will be helpful and solve your issue.

提交回复
热议问题