Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS13 UICollectionView not respecting size returned in delegate method for cell

In iOS13, i return

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
   return collectionView.bounds.size
}

but the displayed cell is hugged horizontally and not fullwidth... this wasn't happening before

is there any change that is responsible? why is this happening?

like image 769
Peter Lapisu Avatar asked Oct 04 '19 15:10

Peter Lapisu


Video Answer


1 Answers

In interface builder, set Estimated size to 'None' from 'Automatic'

enter image description here

like image 176
Peter Lapisu Avatar answered Nov 15 '22 20:11

Peter Lapisu