the behavior of the UICollectionViewFlowLayout is not defined because:
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.
在開發(fā)中用UICollectionView的時候會出現(xiàn)上面的bug恰起,實際上是UICollectionViewFlowLayout的itemSize寬度或者高度設(shè)置有問題,如果是有navigationbar的話纬黎,itemSize的高度應(yīng)該是(屏幕高度 - 狀態(tài)欄高度 - 導(dǎo)航欄高度)
解決方法:
layout.itemSize = CGSizeMake(screenW, screenH - 64);
我這里直接減去64,當(dāng)然最好是通過獲取高度減