czl0325 / ZLCollectionView

为应对类似淘宝首页,京东首页,国美首页等复杂布局而写的Collectionview。基于UICollectionView实现,目前支持标签布局,列布局,百分比布局,定位布局,填充式布局,瀑布流布局等。支持纵向布局和横向布局,可以根据不同的section设置不同的布局,支持拖动cell,头部悬浮,设置section背景色和自定义section背景view,向自定义背景view传递自定义方法。功能强大,超过Android的recyclerview,实现了电影选座等高难度的布局。
MIT License
1.16k stars 166 forks source link

ios 15会闪退 #54

Closed 18621504096 closed 2 years ago

18621504096 commented 2 years ago

在ios15以下可以正常工作但是ios15会闪退报错 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView (<UICollectionView 0x14433f000>) is stuck in its update/layout loop. This can happen for many reasons, including self-sizing views whose preferred attributes are not returning a consistent size. To debug this issue, check the Console app for logs in the "UICollectionViewRecursion" category.' 不知道是什么原因

18621504096 commented 2 years ago

[super invalidateLayoutWithContext:context];

czl0325 commented 2 years ago

怎么会闪退呢?我在模拟器上测试15.5都运行正常,你用我的demo会闪退吗

czl0325 commented 2 years ago

再试看看

czl0325 commented 2 years ago

更新1.4.6

18621504096 commented 2 years ago

因为一直没找到问题用别的第三方先替代了一下,最近找到了这个问题好像是因为我用了预估高度导致的,在ios15以下都可以的ios15以上的就会报错 layout.estimatedItemSize

18621504096 commented 2 years ago

把这一行注释掉就可以了