Ios 如何显示UITableView底部的空白空间?
我有一个在表格视图底部有白色空白区域的表格。但我希望这个区域是灰色的。我添加了一个灰色的页脚,但它太小了 我该怎么办Ios 如何显示UITableView底部的空白空间?,ios,iphone,uitableview,Ios,Iphone,Uitableview,我有一个在表格视图底部有白色空白区域的表格。但我希望这个区域是灰色的。我添加了一个灰色的页脚,但它太小了 我该怎么办 将表格视图的背景色设置为灰色颜色和表格页脚视图为空ui视图 self.tableView.tableFooterView = UIView() self.tableView.backgroundColor = .gray 将tableView的backgroundColor设置为graycolor,并将tableFooterView设置为空UIView self.tableVi
将
表格视图的背景色设置为灰色
颜色和表格页脚视图
为空ui视图
self.tableView.tableFooterView = UIView()
self.tableView.backgroundColor = .gray
将tableView的backgroundColor
设置为gray
color,并将tableFooterView
设置为空UIView
self.tableView.tableFooterView = UIView()
self.tableView.backgroundColor = .gray
添加以下行
self.tableView.tableFooterView=UIView()
它将完美工作。添加以下行
self.tableView.tableFooterView=UIView()
它将完美地工作。如果是因为tableview页脚,则使用以下委托方法,否则如果是背景视图颜色,请修改tableview以适应父视图矩形
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
如果是因为tableview页脚,则使用以下委托方法,否则如果是背景视图颜色,则修改tableview以适应父视图矩形
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
return 0
}
`我添加了一个灰色的页脚,但它太小。`你到底是怎么做到的?@Larme,我将UIView拖放到UITableView。`我添加了一个灰色的页脚,但它太小。`你到底是怎么做到的?@Larme,我将UIView拖放到UITableView@AlexeySubbota删除界面生成器中拖放到tableView
中的灰色视图,并将这两行放到viewDidLoad
@AlexeySubbota删除界面生成器中拖放到tableView
中的灰色视图,并将这两行放到界面生成器中viewDidLoad
中的行。谢谢,它也可以,但我只能接受一个答案。谢谢,它也可以,但我只能接受一个答案。