UICollectionView 中的警告提示

通过xib创建的UICollectionViewCell,在xib中设置了cell size的宽和高,如果之后使用

flow.itemSize = CGSizeMake(cellWidth, cellHeight);动态修改了cell size,并且cell size的小于itemSize,会报一下错误,把xib的view尺寸拉大,并改变cell size的大小,就可以解决这个问题。

 

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.

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>.

 

如果,默认高度229,如果itemSize大于229就会报警告

posted on 2015-10-19 22:08  秋风渡河上  阅读(1297)  评论(0编辑  收藏  举报