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
[self.collectionView.collectionViewLayout invalidateLayout];
[self.collectionView reloadData];
On rotation, but if i scroll through the cells, some of the labels move down because in the cells initWithFrame:
method i set the text labels frame like
_textLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, frame.size.height-27.5, 148.5, 23)];
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?
Heres an image of the issue, the text label should either all be at the bottom, or where the middle one is:
Here is my code for the cell and collection view: https://gist.github.com/MaxHasADHD/cab99e06c7d1e2cf78bb