I have a UICollectionView
that contains some large UICollectionViewCells
. These cells are so large that they completely fill the UICollectionView
bounds and extend off screen.
The problem is that the large cells are removed from the UICollectionView
and queued for reuse while they are still displayed, resulting in a blank view. If I continue scrolling on the blank UICollectionView
area, eventually the final portion of the cell appears and the start of the next cell appears in exactly the right place.
I've effectively disabled cell reuse and the problem still occurs apparently because the UICollectionView
thinks that the cell is no longer displayed since no corner is within the bounds of the collection view.
To demonstrate make a collection view that is a single column and have a cell that is 10000px tall, when scrolling over the very tall cell it will disappear after about 1000px of content is scrolled off the screen and will reappear to display the final 1000px of content for the cell.
You can download a simple prototype app that displays this problem at: http://jack.cox.s3.amazonaws.com/collectionviewprototype.zip
I have used
UICollectionView
with cells of the size of the screen. For iPad the cell size was 768x1024. And haven't found any issues. Please make sure that you have set theMin Spacing For Cells
andFor Lines
are0
Also return correctCGSize
andUIEdgeInsets
as followsThis issue happened for me along with this warning in the debug log:
It seems that the out of the box
UICollectionViewFlowLayout
does not support cells larger than the screen.This issue is being tracked as radar #12889164
Try this fix if you are still looking for a quick solution: When a cell is detected to have a bigger height than the collectionview holding it, the collection view simply needs to be larger than the cell. So set the collecitonView frame to be bigger and correct the content and indicator insets.