UICollectionView exception in UICollectionViewLayoutAttributes from iOS7

后端 未结 7 874
离开以前
离开以前 2020-12-07 15:55

I have done a View in CollectionView with CustomLayout. In iOS6 it worked great but iOS7 it throws an exception like this.

Terminating app due to uncaught exception

相关标签:
7条回答
  • 2020-12-07 16:46

    I had this problem too, because I had code that depended on the content size of the collection view. My code was accessing the content size via the collectionView!.contentSize instead of collectionViewContentSize.

    The former uses the collectionView property of UICollectionViewLayout, while the latter uses the custom-implemented layout property. In my code, the first time the layout was asked for attributes, contentSize had not been set yet.

    0 讨论(0)
提交回复
热议问题