UICollectionViewCell dynamic height with autolayout

前端 未结 3 1019
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 14:54

I am using auto layout with UICollectionViewCell. So the idea is to allow CollectionViewCell to determine it\'s size based on layouts. All the constraints are set properly b

3条回答
  •  庸人自扰
    2020-12-10 15:28

    For your dynamic height of the UICollectionViewCell in UIcollectionViewcontroller , you need to implement below method: -

    (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
    

提交回复
热议问题