Skip to content

Instantly share code, notes, and snippets.

@patelrohan
Created December 22, 2012 11:26
Show Gist options
  • Save patelrohan/4358517 to your computer and use it in GitHub Desktop.
Save patelrohan/4358517 to your computer and use it in GitHub Desktop.
Add for loop to make searchbar color same as navgation controller
searchBar.delegate = self;
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 200.0, 44.0)];
searchBar.placeholder = @"Search Files";
searchBar.userInteractionEnabled=YES;
//searchBar.tintColor=[UIColor clearColor];
//Mark : For Loop for Searchbar Color change
for (UIView *view in self.searchBar.subviews)
{
if ([view isKindOfClass:NSClassFromString(@"UISearchBarBackground")])
{
[view removeFromSuperview];
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment