forkingdog / UITableView-FDTemplateLayoutCell

Template auto layout cell for automatically UITableViewCell height calculating
MIT License
9.93k stars 2.01k forks source link

ios10.2之后处理label自动换行时候会崩溃 #278

Closed stone54240 closed 7 years ago

stone54240 commented 7 years ago
ieliwb commented 7 years ago

怎么解决啊,我也是这里崩溃了

stone54240 commented 7 years ago

母鸡呀

yiios commented 7 years ago

设置 cell 中 label 的 preferredMaxLayoutWidth 属性可以暂时解决这个问题

imwcl commented 7 years ago

preferredMaxLayoutWidth,有的地方没设置没崩溃,有的地方会崩溃,具体是什么原因导致的有人知道么

yiios commented 7 years ago

不太清楚 我目前已知的触发条件是有两个

  1. 10.2系统以上
  2. label 需要换行
faimin commented 7 years ago

尽量少用或者不用大于等于或者小于等于这种约束,这种约束会使autolayout的计算量增加,而且假如在一个方向上有多个视图,其中包含换行label,并在其上添加大于等于这种约束的话,有可能就会导致crash

stone54240 commented 7 years ago

对,只有在10.2以上需要自动换行才会出现。

yiios commented 7 years ago

@faimin 为什么在10.2上这个问题才会出现呢 难道10.2系统修改了关于 lable 换行计算的机制?

faimin commented 7 years ago

@yiios 猜测苹果在10.2的时候应该是更新了计算autolayout布局的算法

shareCourage commented 7 years ago

我也是崩溃了,还在找解决方案,大神咋还没修复这个问题呢

shareCourage commented 7 years ago

设置 cell 中 label 的 preferredMaxLayoutWidth 属性可以暂时解决这个问题 刚使用这个方法,解决了这个问题

weekwood commented 7 years ago

@stone54240 can you provide more error messages?

stone54240 commented 7 years ago

@weekwood 本来设置了label的preferredMaxLayoutWidth属性,解决了这个问题。刚刚看到你的回复,我去把设置代码去掉了,不过现在已经没有这个崩溃的bug了

weekwood commented 7 years ago

@stone54240 Thank your reply. Feel free to upgrade to 1.6.beta. We solved this issue for good.

fenglh commented 7 years ago

10.2 我也是崩溃

xilin commented 7 years ago

10.2用1.6在有些时候不加preferredMaxLayoutWidth还是会崩溃

kennenfromchina commented 5 years ago

这个问题怎么破? 我只有在10.2.1上崩溃