刷新CollectionView 报错the item height must be less that the height of the UICollectionView minus the s

数据请求到了之后 刷新CollectionView 出现下面的错误。

the behavior of the UICollectionViewFlowLayout is not defined because:

2015-03-16 10:56:45.898 XXXXX [664:60b] the item height must be less that the height of the UICollectionView minus the section insets top and bottom values.


有可能是数据在插入之前,页面还没有加载完,导致的错误。

网上找了好久,只要假如一句话就解决问题了:

<span style="color:#00afca;">  </span> self.automaticallyAdjustsScrollViewInsets = NO;

automaticallyAdjustsScrollViewInsets

为YES时,它会找view里的scrollView,并设置scrollView的contentInset为{64, 0, 0, 0}。如果你不想让scrollView的内容自动调整,将这个属性设为NO(默认值YES)。


  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值