Bra*_*rad 5 xcode compiler-warnings suppress-warnings ios uitableviewsectionheader
有人知道这个警告的意思吗?我不明白它所描述的问题。如果我在不应该提供的时候提供了估计的身高,为什么会有问题?
我的目标是iOS 10,因为我想支持较旧的设备。
在tableViewController中,我同时覆盖了heightForFooterInSection和estimatedHeightForFooterInSection(它们各自提供相同的值,是2种可能的高度之一)
我正在使用此方法将视图加载到页脚中:Swift-如何使用XIB文件创建自定义viewForHeaderInSection。
你应该设置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
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
491 次 |
| 最近记录: |