您的位置:首页 > 产品设计 > UI/UE

UICollectionView 中的警告提示

2015-10-19 22:08 337 查看
通过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就会报警告
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: