Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何显示UITableView底部的空白空间?_Ios_Iphone_Uitableview - Fatal编程技术网

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
中的行。谢谢,它也可以,但我只能接受一个答案。谢谢,它也可以,但我只能接受一个答案。