[英]Strange UICollectionView error with high CPU usage in iOS 9
In iOS 8 all went well, but with iOS 9 I get this error message: 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
在iOS 8中一切正常,但是在iOS 9中,我收到此错误消息:
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
I have collectionView
s embedded into tableView
cells. 我有
collectionView
嵌入到tableView
单元格中。 Any idea? 任何想法?
I tried self.automaticallyAdjustsScrollViewInsets = false
, but it does not work. 我尝试了
self.automaticallyAdjustsScrollViewInsets = false
,但是它不起作用。 DenseMapBase
method is get called repeatedly. DenseMapBase
方法被反复调用。
automaticallyAdjustsScrollViewInsets
is most likely unrelated to this as it affects only the first UIScrollView (or it's descendant like UITableView
) in your view hierarchy. automaticallyAdjustsScrollViewInsets
很可能与此无关,因为它仅影响视图层次结构中的第一个UIScrollView(或类似UITableView
的后代)。 The "automatical scroll view inset adjustment" means that if you have an UINavigationBar
in the view, the top content inset of the scroll view is set to the height of the UINavigationBar
so that the bar doesn't overlap the scroll content when contentOffset
is zero (scrolled to top), but the content can be scrolled under the bar and if the bar is not fully opaque you can see the content through (eg like in Safari). “自动滚动视图插入调整”意味着,如果视图中有
UINavigationBar
,则将滚动视图的顶部内容插入设置为UINavigationBar
的高度,以便当contentOffset
为零时, contentOffset
不会与滚动内容重叠(滚动到顶部),但是内容可以滚动到该条下方,如果该条不是完全不透明,则可以看到内容(例如,在Safari中)。
Please check the cell sizes returned by the delegate of the UICollectionView
. 请检查
UICollectionView
的委托返回的单元格大小 。 That error is printed when the delegate returns a cell size that doesn't fit into the UICollectionView
while respecting content and section insets. 当委托返回的单元格大小不适合
UICollectionView
同时尊重内容和节插图时,将显示该错误。 Your collection view's scroll direction is probably horizontal? 您的收藏夹视图的滚动方向可能是水平的?
If so then the delegate method probably returns too big height value for the cell. 如果是这样,则委托方法可能会为单元格返回太大的高度值。 Here's an example:
这是一个例子:
The maximum height of the cell in this case would be 100pt - 2 * 5pt = 90pt 在这种情况下,单元的最大高度为100pt-2 * 5pt = 90pt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.