如何更改uisearchcontroller的背景顏色? Atm它看起來像這樣更改uisearchcontroller的背景顏色
我想要所有的顏色。 我已經嘗試sc.view.tintColor = UIColor.rgb(10, green: 150, blue: 255)
和 sc.view.backgroundColor = UIColor.rgb(10, green: 150, blue: 255)
但不刪除灰位側
如何更改uisearchcontroller的背景顏色? Atm它看起來像這樣更改uisearchcontroller的背景顏色
我想要所有的顏色。 我已經嘗試sc.view.tintColor = UIColor.rgb(10, green: 150, blue: 255)
和 sc.view.backgroundColor = UIColor.rgb(10, green: 150, blue: 255)
但不刪除灰位側
嗯,有一些想法我解決它。
sc.searchBar.barTintColor = UIColor.rgb(10, green: 150, blue: 255)
sc.searchBar.searchBarStyle = UISearchBarStyleProminent
sc.searchBar.backgroundImage = [UIImage new]
sc.searchBar.barTintColor = UIColor.rgb(10, green: 150, blue: 255)
集searchBarStyle以突出。它爲我工作