美文网首页
iOS12.2Bug 点击UICollectionViewCel

iOS12.2Bug 点击UICollectionViewCel

作者: 克洛斯贝尔 | 来源:发表于2019-08-13 12:04 被阅读0次

在使用UICollectionView时,点击其中的cell,弹出一个ActionSheet。
此时就会出现一个奇怪的约束bug。

"<NSLayoutConstraint:0x6000011d4870 UIView:0x7ff63fc03e60.width == - 16 (active)>"

Demo

演示如下


bug.gif

猜测是弹出ActionSheet导致Cell的ContentView约束变化,这个-16可能和ConetnView 一开始的layoutMargins的默认值(8,8,8,8)有关, 当Cell的为宽度为0,这个约束使得ContenView的Width变为-16。
搜索一下,暂时没有解决方案,但是好在这个不影响使用。


https://github.com/lionheart/openradar-mirror/issues/21120
github搜到的类似问题,同样没有好的解决方案。
疑似iOS12.2以上的bug.

相关文章

网友评论

      本文标题:iOS12.2Bug 点击UICollectionViewCel

      本文链接:https://www.haomeiwen.com/subject/bdsvjctx.html