Reputation: 5673
In my view I have a UITableView
which contains cells with horizontal UICollectionView
inside. The problem is that sometimes UICollectionViewCell
s are not rendered on device/simulator. At the same time I can see those cells in the View Hierarchy Debugger:
What I see in the View Hierarchy Debugger:
As you can see, cells (with images) exist and have correct frames and content (proved by the View Hierarchy Debugger). Nevertheless they are not rendered on device/simulator for some reason. What could be the cause of that and how could I fix it?
UPD: another example with "3D" view and bug on one cell, but not on the other
Upvotes: 10
Views: 995
Reputation: 5673
It turned out that my particular problem is related to UICollectionView assertion error on stale data because sometimes mentioned crash happens. Playing around [collectionViewLayout invalidateLayout]
I finally fixed this.
Just to record what was NOT the cause (and what you should check if faced with the same problem):
If none of the above is the cause of issue try invalidateLayout
somewhere around reloadData
or inside of layoutSubviews
or similar method.
Upvotes: 1