swift3.0
TableView头高度和脚高度
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 4
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 2
}
我是一只是这样设置的但是在用swift4.0时设置没有卵用了~~~~~~~~~~~~~
在创建TableView时添加1,2 或 3,4两行代码
tableview.estimatedSectionHeaderHeight = 4
tableview.estimatedSectionFooterHeight = 2
tableview.sectionHeaderHeight = 4
tableview.sectionFooterHeight = 2
运行解决~~~~~~~~~
网友评论