我尝试将 headerView 的边框颜色更改为冲浪绿,但似乎我的代码不起作用。我尝试的是这样的:
tableView.tableHeaderView?.layer.borderColor = UIColor(red: 105.0/255.0, green: 215.0/255.0, blue: 189.0/255.0, alpha: 1.0).CGColor
tableView.tableHeaderView?.layer.masksToBounds = true
但是,标题的边框仍然是这样的:
Here is the Image (抱歉,我没有足够的声誉来发布图片)
如您所见,边框仍然是黑色/深蓝色。
任何帮助将不胜感激!提前致谢!
最佳答案
我认为导航栏和搜索栏之间的边框有问题...
searchBar.backgroundImage = UIImage()
一些更改边框的示例:
searchBar.layer.borderWidth = 1
searchBar.layer.borderColor = someColor.CGColor
关于ios - Swift:如何在 TableView Controller 中以编程方式更改 tableHeaderView 边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35640461/