CollectionView报错:the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.

collectionView报错:

2016-12-08 18:19:54.774 PandaTVHomeDemo[21698:1193380] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2016-12-08 18:19:54.775 PandaTVHomeDemo[21698:1193380] The relevant UICollectionViewFlowLayout instance is , and it is attached to ; layer = ; contentOffset: {0, -64}; contentSize: {0, 0}> collection view layout: .
2016-12-08 18:19:54.775 PandaTVHomeDemo[21698:1193380] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.```

解决方法: 
在collectionView所在的控制器中设置以下属性即可解决:
```self.automaticallyAdjustsScrollViewInsets = No```
当此属性默认为YES时,导航控制器下的scrollView的contentInset会被自动调整为为{64, 0, 0, 0}bao

你可能感兴趣的:(CollectionView报错:the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.)