ios – 为什么UITableViewAutomaticDimension不适用于sectionFooterHeight?

前端之家收集整理的这篇文章主要介绍了ios – 为什么UITableViewAutomaticDimension不适用于sectionFooterHeight?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
嗨,有很多问题要回答UITableView的UITableViewCell的动态高度.但是当我为sectionFooterHeight做这件事时,我觉得很奇怪.

代码为:

tableView.sectionHeaderHeight = UITableViewAutomaticDimension
 tableView.estimatedSectionHeaderHeight = 25

 tableView.sectionFooterHeight = UITableViewAutomaticDimension
 tableView.estimatedSectionFooterHeight = 50

并且在xib中为页脚视图设置了约束

虽然它适用于headerview但不适用于页脚

解决方法

我认为你需要实现tableView:heightForFooterInSection:并返回UITableViewAutomaticDimension

猜你在找的iOS相关文章