首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UIFlowLayoutSection.updateEstimatedSizeForSection中的EXC_ARITHMETIC

UIFlowLayoutSection.updateEstimatedSizeForSection中的EXC_ARITHMETIC
EN

Stack Overflow用户
提问于 2016-02-05 13:07:18
回答 1查看 1.4K关注 0票数 2

在试图显示UICollectionView时,模拟器中会出现以下错误:

代码语言:javascript
复制
    UIKit`-[_UIFlowLayoutSection updateEstimatedSizeForSection:]:
    ...
    0x106d32858 <+582>:  movq   0x416909(%rip), %rcx      ; _UIFlowLayoutSection._validItemRange
    0x106d3285f <+589>:  xorl   %edx, %edx
->  0x106d32861 <+591>:  divq   0x8(%rcx,%rbx) 

Thread 1: EXC_ARITHMETIC (code=EXC_I386_DIV, subcode=0x0)

我已经正确地设置了估计的单元格大小,并且设置集合视图的高度大于单元格高度。所有的嵌入都被设置为0。但在坠机前,我仍然收到以下警告:

代码语言:javascript
复制
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.
Please check the values return by the delegate.
The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fe65d28b7c0>, and it is attached to <UICollectionView: 0x7fe65c859000; frame = (5 63; 365 110); clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x7fe65d28bea0>; animations = { opacity=<CABasicAnimation: 0x7fe65d702fd0>; bounds.origin=<CABasicAnimation: 0x7fe65d704610>; bounds.size=<CABasicAnimation: 0x7fe65d704630>; }; layer = <CALayer: 0x7fe65d03a0b0>; contentOffset: {0, 0}; contentSize: {1798, 110}> collection view layout: <UICollectionViewFlowLayout: 0x7fe65d28b7c0>.
Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-07 00:03:37

我通过将UIImageView大小设置为集合视图单元格中的固定大小来修正这个问题,而不是使用约束将图像视图扩展到单元格的大小。

这很奇怪,因为UICollectionView不应该将单元格缩放到大于dataSource中返回的大小。此外,当UIImageView = true时,clipsToBounds大小与单元格大小有什么关系?只要单元格本身有正确的大小,UICollectionView甚至不应该知道单元格包含什么视图。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35225045

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档