Reputation: 4345
I'm trying to change the background color of my search bar. I want this top view to be one solid color. Here's the code I'm using:
[titleBarView setBackgroundColor:[ColorUtil colorWithHexString:@"1ABC9C"]];
searchBar.barTintColor=[ColorUtil colorWithHexString:@"1ABC9C"];
searchBar.backgroundColor=[ColorUtil colorWithHexString:@"1ABC9C"];
And below is the result I'm getting. Notice that there's some gray along the top and bottom edges of the search bar. How do I get rid of this?
EDIT: After adding
searchBar.searchBarStyle=UISearchBarStyleMinimal;
I now get this:
So my original issue is solved, but now the interior of the searchBar is the wrong color. What property governs that?
Upvotes: 0
Views: 1931
Reputation: 2818
What about your view hierarchy? Have you tried [searchBar setBarTintColor:[UIColor clearColor]];
Upvotes: 1