系统版本: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