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

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容