Is it possible to change the border color of a UISearchDisplayController's search bar?

Posted by prendio2 on Stack Overflow See other posts from Stack Overflow or by prendio2
Published on 2010-04-24T01:34:18Z Indexed on 2010/04/24 1:43 UTC
Read the original article Hit count: 584

I have a UISearchBar added as my table header with the following code.

searchBar = [[UISearchBar alloc] initWithFrame:self.tableView.bounds];
searchBar.tintColor = [UIColor colorWithWhite:185.0/255 alpha:1.0];
[searchBar sizeToFit];
self.tableView.tableHeaderView = searchBar;

Then I set my UISearchDisplayController up as follows.

searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
[searchDisplayController setDelegate:self];
[searchDisplayController setSearchResultsDataSource:self];

Everything functions as I would like except that the UISearchDisplayController has added a blue(ish) border above the search bar — this bar does not recognise the tintColor I have set on the search bar.

Is it possible to change the color of this bar? It is obviously not absolutely crucial but that line is going to bug me forever if it stays blue like that!

zoomed in on UISearchBar

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uisearchbar