To the point: This is happening only when I test in smaller screen sizes because looks like the cell size fits only with iphone 6+. What I would like to know is how to set a size that fix with all devices?
Details: I know this question existshere and here but I've tried everything said in the first question and in the second one it's different because they only manage to solve a specific problem that happens when they change from portrait to landscape and the size of the cells changes. In my case my app is portrait and the size of the cell is not set to be bigger than it's container in storyboard, as you can see in the pictures. But look like the size only fit with an iphone 6+ screen and when I use a smaller device I have this warning:
the behavior of the UICollectionViewFlowLayout is not defined because:
2016-08-25 12:27:12.719 xxx[2722:761734] 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.
2016-08-25 12:27:12.720 xxx[2722:761734] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x15a018930>, and it is attached to <UICollectionView: 0x156994000; frame = (14 287.5; 292 45); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x159dd0020>; layer = <CALayer: 0x159d55dd0>; contentOffset: {0, 0}; contentSize: {572, 0}> collection view layout: <UICollectionViewFlowLayout: 0x15a018930>.
2016-08-25 12:27:12.720 xxx[2722:761734] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
I have set a symbolic breakpoint but the only thing I see is this:
My cell size and collection view size is here :
The size of the cell is equal or smaller in all the cases. The only thing I change in code is the height of the collection view that contains the cells. And I set its size bigger, to allow more cells in the case there are more cells to display.
What I would like to know is how to set the correct values of the UICollectionViewCell size for each device, and what it cannot be done in storyboard??
Thanks a lot