The behavior of the UICollectionViewFlowLayout is not defined because

image.png

1.问题关键如下
the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.

通过分析UICollectionView中cell的大小超出屏幕,一般是item计算时,因小数的问题导致的(如.333,.666),可通过Int取整进行避免。

2.可以通过捕获断点UICollectionViewFlowLayoutBreakForInvalidSizes去定位


image.png

问题解决后,断点将无法捕获。

你可能感兴趣的:(The behavior of the UICollectionViewFlowLayout is not defined because)