2016-02-25 44 views
0

我尝试将headerView的边框颜色更改为冲浪绿色,但似乎我的代码不起作用。我试过是这样的:Swift:如何在tableViewController中以编程方式更改tableHeaderView的边框颜色

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(对不起,我没有足够的信誉发表图片)

正如你所看到的,边框仍然是黑色/深蓝色。

任何帮助将不胜感激!提前致谢!

回答

0

我想有一个与导航栏和搜索栏之间的边界问题...在this link for solution

searchBar.backgroundImage = UIImage() 

检查一些例子来改变边界:

searchBar.layer.borderWidth = 1 
searchBar.layer.borderColor = someColor.CGColor 
相关问题