Note that there are some explanatory texts on larger screens.

plurals
  1. POUICollectionViewCell rotation
    primarykey
    data
    text
    <p>I have a collection view, that no matter what device there are 4, equally sized cells that fit in an area on the screen. That area is the device height-20-50-3/2. 20 is the status bar, 50 is a cancel button and 3 is 1px line at top, between the cell and bottom. On the 4" screen the cell size in portrait is also the same size in landscape, so its always the same. But on the 4S, the cells get bigger. I call</p> <pre><code>[self.collectionView.collectionViewLayout invalidateLayout]; [self.collectionView reloadData]; </code></pre> <p>On rotation, but if i scroll through the cells, some of the labels move down because in the cells <code>initWithFrame:</code> method i set the text labels frame like</p> <pre><code> _textLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, frame.size.height-27.5, 148.5, 23)]; </code></pre> <p>So it looks like this line is being called because they move, but if i scroll down, then back up then the label is back in its previous place. How can i fully reload this data and make it resize all the content of the cells without it messing around and reframing when i scroll?</p> <p>Heres an image of the issue, the text label should either all be at the bottom, or where the middle one is:</p> <p><img src="https://i.stack.imgur.com/2ZI8I.png" alt="enter image description here"></p> <p>Here is my code for the cell and collection view: <a href="https://gist.github.com/MaxHasADHD/cab99e06c7d1e2cf78bb" rel="nofollow noreferrer">https://gist.github.com/MaxHasADHD/cab99e06c7d1e2cf78bb</a></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.
    1. This table or related slice is empty.
    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