您的位置:首页 > 移动开发 > IOS开发

iOS 开发过程中遇到的Bug和Warning收录(持续更新)

2016-06-15 10:34 543 查看
1.CollectionView的小警告

2015-08-18 16:07:51.523 Example[16070:269647] the behavior of the UICollectionViewFlowLayout
is not defined because: 2015-08-18 16:07:51.523

Example[16070:269647] the item width must be less than the width of the
UICollectionView minus the section insets left and right values, minus the content insets left and right values.

2015-08-18 16:07:51.524 Example[16070:269647] The relevant UICollectionViewFlowLayout
instance is , and it is attached to ; animations = { position=; bounds.origin=; bounds.size=; }; layer = ; contentOffset: {0, 0}; contentSize: {1024, 770}> collection view layout: . 2015-08-18 16:07:51.524 Example[16070:269647] Make a symbolic breakpoint at
UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

解决:

Its
happens because your collection view cell's width is bigger than collection view width after rotation.suppose that you have a 1024x768 screen and your collection view fills the screen.When your device is landscape,your cell's width will be self.collectionView.frame.size.width
- 20 =1004 and its greater than your collection view's width in portrait = 768.The debugger says that "the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right
values".

当你cell的宽度比你collectionView的宽度还要宽的时候,假如你的screen是1024*768的,当你的设备旋转的时候,你的cell宽度将会是大于你的screen宽度768.所有debugger就会告诉你the
item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values,只要把你的collectionView的宽度高度始终保持大于cell的宽度和高度就行了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: