UIFlowLayout:the behavior of the UICollectionViewFlowLayout is not defined
2016-08-28 19:57
459 查看
一.具体报错的内容如下:
the behavior of the UICollectionViewFlowLayout is not defined because:
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.
The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fce90e3d6c0>, and it is attached to <UICollectionView: 0x7fce918f2600; frame = (0 0; 375 200); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x7fce90e3ceb0>; layer = <CALayer: 0x7fce90e3bb70>; contentOffset: {0, 0}; contentSize: {0, 200}> collection view layout: <UICollectionViewFlowLayout: 0x7fce90e3d6c0>.
二. 原因分析
UICollectionViewFlowLayout的itemSize的宽或者高设置的有问题!它的size必须在父容器的范围之内!父容器UICollectionView的高度为200,但是在设置itemSize高度的时候设置成250了。
self.flowLayout.itemSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 250);
三.解决方法
将itemSize的高度也改的和父容器UICollectionView一致,即200.self.flowLayout.itemSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 200);
相关文章推荐
- 【iOS】The behavior of the UICollectionViewFlowLayout is not defined because:
- iOS - 解决the behavior of the UICollectionViewFlowLayout is not defined
- the behavior of the UICollectionViewFlowLayout is not defined because:
- The behavior of the UICollectionViewFlowLayout is not defined because 解决办法!
- the behavior of the UICollectionViewFlowLayout is not defined because:
- 04 - the behavior of the UICollectionViewFlowLayout is not defined
- UISearchController Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior
- BottomSheetBehavior 之 java.lang.IllegalArgumentException: The view is not associated with BottomSheetBehavior
- Probably ResourceManager is not defined in the View【ASP.NET MVC4+EXT.NET配置常见错误】
- Attempting to load the view of a view controller while it is deallocating is not allowed and may res
- MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法
- Attempting to load the view of a view controller while it is deallocating is not allowed and may res
- MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法
- It is not possible to run two different versions of ASP.NET in the same IIS process.问题的解决
- error 18483: could not connect to server 'dalian' because 'distributor_admin' is not defined as a remote login at the server.
- the resource is not on the build path of a java project
- Version 1.3.1_01 of the JVM is not suitable for this product.Version:1.4.1 or greater is required。
- 'ddlCities' has a SelectedValue which is invalid because it does not exist in the list of items
- .Net 连接池的配置Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.”
- The mapping of interface member IDisplayOrder.ID is not supported.