I am trying to configure iOS 8 to automatically calibrate cells in a UICollectionViewController :
I created a basic project using StoryBoards and developed one UICollectionViewCell there with a label limited to cell restrictions. Then I associated this cell label with the Cell class to access it programmatically.
Without specifying estimatedItemSize everything works fine (except for auto-size, of course).
When I specify estimatedItemSize as follows:
- (void)viewDidLoad { [super viewDidLoad]; UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)self.collectionViewLayout; layout.estimatedItemSize = CGSizeMake(100.0f, 30.0f); }
Applications crash with these error messages:
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. Please check the values return by the delegate.
I think I'm setting estimatedItemSize in the wrong place, or if I already have a specific item size configured in the storyboard, so that it somehow conflicts with the estimated size.
source share