gpt4 book ai didi

来自 iOS7 的 UICollectionViewLayoutAttributes 中的 UICollectionView 异常

转载 作者:行者123 更新时间:2023-12-03 10:17:59 29 4
gpt4 key购买 nike

我已经使用 CustomLayout 在 CollectionView 中完成了一个 View 。在 iOS6 中它运行得很好,但在 iOS7 中它抛出了这样的异常。

由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:

'layout attributes for supplementary item at index path ( {length = 2, path = 0 - 0}) changed from CustomSupplementaryAttributes: 0xd1123a0 index path: (NSIndexPath: 0xd112580 {length = 2, path = 0 - 0}); element kind: (identifier); frame = (0 0; 1135.66 45); zIndex = -1; to CustomSupplementaryAttributes: 0xd583c80 index path: (NSIndexPath: 0xd583c70 {length = 2, path = 0 - 0}); element kind: (identifier); frame = (0 0; 1135.66 45); zIndex = -1; without invalidating the layout'

最佳答案

您需要在更新之前使现有布局无效,请参阅错误消息的末尾:

without invalidating the layout'


[collectionViewLayout invalidateLayout];

Apple Documentation for UICollectionViewLayout

关于来自 iOS7 的 UICollectionViewLayoutAttributes 中的 UICollectionView 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19207924/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com