經過xib建立的UICollectionViewCell,在xib中設置了cell size的寬和高,若是以後使用less
flow.itemSize = CGSizeMake(cellWidth, cellHeight);動態修改了cell size,而且cell size的小於itemSize,會報一下錯誤,把xib的view尺寸拉大,並改變cell size的大小,就能夠解決這個問題。ip
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.it
2015-10-19 22:04:05.893 meibo[37852:467001] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7ff2d042d7c0>, and it is attached to <UICollectionView: 0x7ff2d1091e00; frame = (0 0; 414 168.333); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x7ff2d06a9aa0>; layer = <CALayer: 0x7ff2d06a8690>; contentOffset: {0, 0}; contentSize: {0, 229}> collection view layout: <UICollectionViewFlowLayout: 0x7ff2d042d7c0>.io
若是,默認高度229,若是itemSize大於229就會報警告cli