UICollectionViewCell gets hidden randomly

前端 未结 3 1219
耶瑟儿~
耶瑟儿~ 2021-01-03 10:36

I have a UIView in which I am adding a UICollectionView to act as a banner view to look like a carousel. The Viewcontroller in which UIView

3条回答
  •  耶瑟儿~
    2021-01-03 10:56

    I've encountered the same problem.

    After

    • checking if the UICollectionView reloadData was called in some thread other than the MainThread
    • checking if there is any cases about multi-calling reloadData or updateconstraints

    without solving my problem, I realized that in some occasions CGSizeZero was returned for collectionView:layout:sizeForItemAtIndexPath:.

    When avoiding the CGSizeZero result, everything works well.

提交回复
热议问题