Reputation: 2773
How does one change the background colour of the uisearchcontroller? Atm it looks like this
I want it all one colour.
I've attempted sc.view.tintColor = UIColor.rgb(10, green: 150, blue: 255)
and
sc.view.backgroundColor = UIColor.rgb(10, green: 150, blue: 255)
but doesn't remove the grey bit the side
Upvotes: 8
Views: 12040
Reputation: 39
This works for me simplely
searchController.searchBar.backgroundColor = UIColor.clear
according to https://forums.developer.apple.com/thread/121871
Upvotes: 0
Reputation: 123
sc.searchBar.searchBarStyle = UISearchBarStyleProminent
sc.searchBar.backgroundImage = [UIImage new]
sc.searchBar.barTintColor = UIColor.rgb(10, green: 150, blue: 255)
set searchBarStyle to Prominent. It working for me
Upvotes: 12
Reputation: 2773
Eh, with some thought I solved it.
sc.searchBar.barTintColor = UIColor.rgb(10, green: 150, blue: 255)
Upvotes: 15