forkingdog / UITableView-FDTemplateLayoutCell

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

多行Label,cell的高度计算不正确 #372

Open gaoshilei opened 6 years ago

gaoshilei commented 6 years ago

UITableView里面的Label不能自动换行,添加属性preferredMaxLayoutWidth设置宽度之后,自动换行OK,FDTemplateLayoutCell计算的高度不对了

gaoshilei commented 6 years ago

使用的是Masonry纯代码布局

fengyunjue commented 6 years ago

测试发现,ios10正常,ios11计算高度不对

lyluoyuan commented 6 years ago

同样的问题。原来可以在heightforrow里返回UITableViewAutomaticDimension就自适应了。(这个东西ios5的时候就有了,我现在才看到🤦‍♂️)。

GHeminghui commented 6 years ago

多半是约束的原因吧,建议研究下Content hugging Priority 和 Content Compressionn Resistance Priority