I made a UICollectionView
and it displays fine on most types of iPhones. However, on smaller devices like the iPhone SE, the collection view cell runs off the page even though I set my constraints correctly. I get the following error:
the behavior of the UICollectionViewFlowLayout is not defined because:
the item width must be less than the width of the UICollectionView minus
the section insets left and right values, minus the content insets left and right values.
I tried many of the other solutions people mentioned such as self.collectionView.collectionViewLayout.invalidateLayout()
or setting contentInsetAdjustmentBehavior
to .never
(link here), but so far none of them have worked and the collection view still runs off the page for smaller iOS devices. Any help would be greatly appreciated.