UICollectionView Layout Issue

Nitesh picture Nitesh · Apr 15, 2013 · Viewed 52.5k times · Source

I am using UICollectionView using the flow layout. I have made a custom UICollectionViewCell for the same. But on running the project the console keeps on throwing this error-

The behavior of the UICollectionViewFlowLayout is not defined because:
 the item height must be less that the height of the UICollectionView minus the section insets top and bottom values.

I have made sure that the size of the cell is correct

Has anyone been able to resolve this issue.

Answer

Connor Wagner picture Connor Wagner · Jan 11, 2014

I found that, using storyboards, you have to go into the storyboard and click on the overall View Controller (the view should be highlighted in blue) and go to the Attributes Inspector (the fourth tab on the right side of the screen) and unchecking the "Under Top Bars", "Under Bottom Bars", and "Under Opaque Bars." This cleared up the issue for me, and it cleared it for my coworkers as well.