OGeek|极客世界-中国程序员成长平台

标题: ios - 改变 tableView?.tableFooterView 的颜色 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 14:53
标题: ios - 改变 tableView?.tableFooterView 的颜色

enter image description here

我创建了一个如图所示的 tableView。部分和单元格之间有空间。所以空间的颜色就是tableview默认颜色。

为了删除 tableview 上的多余行,我在 tableView?.tableFooterView 中添加了 UIVIew()。

let footerView = UIView()
self.tableView?.tableFooterView = footerView

我想让 UIView 的颜色在图片上的“目标颜色”中相同。

我尝试了下面的方法,但它不起作用。

let footerView = UIView()
footerView.backgroundColor = UIColor.black
footerView.tintColor = UIColor.black
self.tableView?.tableFooterView = footerView

我该怎么办? 谢谢!



Best Answer-推荐答案


尝试为此设置 tableViewbackgroundColor

self.tableView?.backgroundColor = UIColor.white //Or color that you want

关于ios - 改变 tableView?.tableFooterView 的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42027900/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4