forkingdog / UITableView-FDTemplateLayoutCell

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

终于发现作者为什么不更新了。我猜是这个原因。(希望懂的人指导指导一下) #287

Closed binfy closed 7 years ago

binfy commented 7 years ago

最近在做项目的时候,一个UITableViewCell的.xib 的autolayout布局,就一个label。上下左右到contentView的上下左右。然后这个库还是在计算高度的时候出现约束冲突,虽然程序没有崩了,看着输出的约束,心里老难受了。然后就各种想办法解决。后来发现自己的app已经是最低版本是8.0(这个和老大商量过得,现在8.0下面的应用应该很少了,我买的那个4s都换了,估计用的人也很少很少了 吧)。我用的self.tableView.estimatedRowHeight = 44; self.tableView.rowHeight = UITableViewAutomaticDimension;发现程序的高度布局一点问题都没有。

或许这就是作者不在更新这个库的原因吧。不知道我的想法对不对,我的列表数据很少很简单,复杂的布局不知道是什么效果,慢慢再测试吧!希望懂的人指导指导一下。

anyuhao commented 7 years ago

根本是你不会用

anyuhao commented 7 years ago

你得有底部约束,才行的,多看看一些博客. 你不给contentView的最后一个视图的底部约束,contentView怎么知道什么时候结束,所以算不出来高度

binfy commented 7 years ago

亲,我加了,我都说是上下左右都加了的

binfy commented 7 years ago

我有的地方用这个库没问题,有的地方有问题,真纠结哦

binfy commented 7 years ago

我发现 self.tableView.estimatedRowHeight = 44; self.tableView.rowHeight = UITableViewAutomaticDimension; 这样写也不好,也会有问题,特别是cell多的时候。

anyuhao commented 7 years ago

可能得设置Label.期望宽度吧

binfy commented 7 years ago

@anyuhao 怎么设置呢?

binfy commented 7 years ago

@anyuhao preferredMaxLayoutWidth是这个吗?我设置0了

afantree commented 7 years ago

这个库是解决图文排列等复杂的cell布局算高问题,列表数据很少很简单的话,就简单一些处理。 另,木发现什么版本兼容方面的大问题。。。