, iOS7, , UISearchBarBackground.
.
- (void) removeUISearchBarBackgroundInViewHierarchy:(UIView *)view
{
for (UIView *subview in [view subviews]) {
if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) {
[subview removeFromSuperview];
break;
} else {
[self removeUISearchBarBackgroundInViewHierarchy:subview];
}
}
}
You can simply submit your search bar to the method and change the color later, a little like the suggested answers above.
[self removeUISearchBarBackgroundInViewHierarchy:self.searchDisplayController.searchBar]
self.searchDisplayController.searchBar.backgroundColor = yourUIColor;
source
share