2016-02-25 65 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 
相關問題