有人知道这个警告的意思吗?我不明白它描述的问题。如果我在不应该提供的情况下提供了估计高度,为什么会有问题?
我的目标是 iOS 10,因为我想支持旧设备。
在 tableViewController 中,我覆盖了 heightForFooterInSection
和 estimatedHeightForFooterInSection
(它们都提供相同的值,2 个可能的高度之一)
我正在使用此方法将 View 加载到页脚中:Swift - How creating custom viewForHeaderInSection, Using a XIB file?
最佳答案
您应该将0
设置为Estimate
并实现heightForHeaderInSection
:
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
let headerHeight: CGFloat = 40
if #available(iOS 11.0, *) {
tableView.estimatedSectionHeaderHeight = headerHeight
return UITableView.automaticDimension
} else {
return headerHeight
}
}
关于ios - xcode 警告 "estimated section footer height before ios 11"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54031018/