如何染UITableView底部空的空间?
设置tableView's
backgroundColor
为gray
颜色和tableFooterView
空UIView
self.tableView.tableFooterView = UIView()
self.tableView.backgroundColor = .gray
我已经试过但没有成功。 –
@AlexeySubbota删除灰色视图,您可以在界面生成器中拖放'tableView'并将这两行放入'viewDidLoad'中。 –
添加下面的线,
self.tableView.tableFooterView = UIView()
它将完美的作品。
谢谢,它也可以,但我只能接受一个答案。 –
好吧,先生。快乐编码... –
如果因为tableview中的页脚然后使用下面的委托方法否则,如果它的背景视图颜色修改你的tableview,以适应父视图的rect
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
'我添加了一个灰色的页脚,但它太small.'你是怎么做到的? – Larme
@Larme,我拖放UIView到UITableView –