How can a get the auto layout size of the UICollectionViewCells in iOS 8? (systemLayoutSizeFittingSize returns size with zero height in iOS 8)

后端 未结 8 532
心在旅途
心在旅途 2021-01-30 14:21

Since iOS 8 [UIColletionViewCell systemLayoutSizeFittingSize:UILayoutFittingCompressedSize] returns a size with height of 0.

Here\'s what the code

8条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 14:56

    I had the same issue for UITableViewCells and iOS 7 (ios8 works perfectly), but "Triet Luong" solution worked for me:

    return [sampleCell.containerView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
    

提交回复
热议问题