2016-07-29 35 views
5

如何更改uisearchcontroller的背景顏色? Atm它看起來像這樣enter image description here更改uisearchcontroller的背景顏色

我想要所有的顏色。 我已經嘗試sc.view.tintColor = UIColor.rgb(10, green: 150, blue: 255)sc.view.backgroundColor = UIColor.rgb(10, green: 150, blue: 255)但不刪除灰位側

回答

8

嗯,有一些想法我解決它。

sc.searchBar.barTintColor = UIColor.rgb(10, green: 150, blue: 255)

5
 sc.searchBar.searchBarStyle = UISearchBarStyleProminent 
    sc.searchBar.backgroundImage = [UIImage new] 
    sc.searchBar.barTintColor = UIColor.rgb(10, green: 150, blue: 255) 

集searchBarStyle以突出。它爲我工作