UICollectionViewFlowLayout estimatedItemSize does not work properly with iOS12 though it works fine with iOS 11.*
问题 For UICollectionView's dynamic height cells we use, if let layout = self.collectionViewLayout as? UICollectionViewFlowLayout { layout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize } with the proper constraint of height and width, it works fine with iOS 11.* versions but it breaks and does not make the cells dynamic for iOS 12.0 回答1: In my case, I solved this by explicitly adding the following constraints to the cell's contentView. class Cell: UICollectionViewCell { // ...