Note that there are some explanatory texts on larger screens.

plurals
  1. POLarge UICollectionViewCell stopped being displayed when scrolling
    primarykey
    data
    text
    <p>The same behavior of <code>UICollectionView</code> as described here has been led to <a href="https://stackoverflow.com/questions/13016302/large-cells-in-a-uicollectionview-getting-removed-while-the-cell-is-still-displa">this question</a>. Even though I decided to post my own one, because I did further investigations, I didn't want to post in a comment or in edit of the question mentioned above.</p> <p><strong>What happens?:</strong></p> <p>When large cells being displayed in a <code>UICollectionView</code> with a <code>UICollectionViewFlowLayout</code>, after scrolling the collection view to a certain offset, the cells will disappear.</p> <p>When scrolling further until another cell comes into visible area, the vanished/hidden cell becomes visible again. </p> <p>I tested with a vertical scrolling collection view and full-width-cells, but I'm rather sure, that it would also happen with similar setups for horizontal scrolling.</p> <p><strong>What are large cells?:</strong></p> <p>The described behavior happens with cells higher than twice the display height (<code>960.f + 1.f</code> on 3,5 inch displays, <code>1136.f + 1.f</code> on 4 inch).</p> <p><strong>What <em>exactly</em> happens?:</strong></p> <p>When the scrolling offset of the collection view exceeds <code>cell.frame.origin.y + displayHeightOfHardware</code> the cells hidden property is set to <code>YES</code> and <code>-collectionView:didEndDisplayingCell:forItemAtIndexPath:</code> gets called (e.g. the first cell changes to hidden when <code>scrollingOffset.y</code> reaches <code>481.f</code> on 3,5-inch-iPhone).</p> <p>As described above, when scrolling until next cell comes into view, the hidden cell gets displayed again (i.e. hidden property changes to <code>NO</code>) and furthermore, when scrolling far enough the cell will never vanish again, when it shouldn't, no matter where you scroll to.</p> <p>This changes when working with cells larger than triple-display-height (<code>1441.f/1705.f</code>). Those show the same behavior, but it stays the same, no matter how far they're being scrolled up and down.</p> <p><strong>What else?:</strong></p> <p>The situation can not be fixed by overriding <code>-(BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds</code> to return <code>YES</code>.</p> <p>The cells cannot being forced to display with setting the hidden property to <code>NO</code> programmatically after they were hidden (in <code>didEndDisplayingCell</code> for example) </p> <p><strong>So, whats the question?:</strong></p> <p>I'm pretty sure, that this is a bug in <code>UICollectionView/Controller/Cell/Layout</code> and I'll submit a TSI at Apple. But for the meantime: <strong>Has anyone any ideas for a quick hack solution</strong>?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload