美文网首页
UICollectionView 报错

UICollectionView 报错

作者: 窗内户外 | 来源:发表于2017-11-29 14:23 被阅读0次

系统版本:IOS_11_0

报错内容:

The behavior of the UICollectionViewFlowLayout is not defined because:
2017-11-29 10:45:10.220202+0800 GHK_AfarWheel[42989:627216] 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.
2017-11-29 10:45:10.221984+0800 GHK_AfarWheel[42989:627216] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fc5e0e28de0>, and it is attached to <UICollectionView: 0x7fc5e1895000; frame = (0 0; 414 180); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x60000045dd60>; layer = <CALayer: 0x604000230a40>; contentOffset: {414, 0}; contentSize: {2070, 180}; adjustedContentInset: {64, 0, 0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7fc5e0e28de0>.
2017-11-29 10:45:10.222138+0800 GHK_AfarWheel[42989:627216] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

解决办法:

  #ifdef __IPHONE_11_0

    if (@available(iOS 11.0, *)) {

        _collectionView.contentInsetAdjustmentBehavior = UIApplicationBackgroundFetchIntervalNever;
    }
  #endif

相关文章

网友评论

      本文标题:UICollectionView 报错

      本文链接:https://www.haomeiwen.com/subject/bbkubxtx.html