The behavior of the UICollectionViewFlowLayout is not defined because:

The behavior of the UICollectionViewFlowLayout is not defined because:

2021-08-12 15:27:50.397258+0800 MyBox[29635:2423726] 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.

2021-08-12 15:27:50.398250+0800 MyBox[29635:2423726] The relevant UICollectionViewFlowLayout instance is , and it is attached to ; animations = { bounds.origin=; bounds.size=; bounds.origin-2=; bounds.size-2=; }; layer = ; contentOffset: {0, -64}; contentSize: {2629, 667}; adjustedContentInset: {64, 0, 0, 0}; layout: ; dataSource: >.

2021-08-12 15:27:50.399596+0800 MyBox[29635:2423726] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

cell的itemSize和和collectionView的size一样,但是点击cell上的图片隐藏显示导航栏,状态栏时控制台会打印上述日志,排除方法:

ViewDidLoad中添加:self.automaticallyAdjustsScrollViewInsets = false;

你可能感兴趣的:(The behavior of the UICollectionViewFlowLayout is not defined because:)