我使用 UIView() 删除单独的行,它可以工作,但更改页脚视图的背景颜色不起作用。这是我的代码。有人可以解释为什么吗?非常感谢!
let footerView = UIView()
footerView.backgroundColor = UIColor(hexString: "#F7F9FC")
myTableView.tableFooterView = footerView
Run Code Online (Sandbox Code Playgroud)
这是因为您的 footerView 的大小为零。
let footerView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 40.0))
footerView.backgroundColor = UIColor(hexString: "#F7F9FC")
myTableView.tableFooterView = footerView
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
91 次 |
| 最近记录: |