Created
June 19, 2012 20:27
-
-
Save jeksys/2956352 to your computer and use it in GitHub Desktop.
UISearchBar custom background
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (id img in searchBar.subviews) { | |
if ([img isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) { | |
[img removeFromSuperview]; | |
} | |
} | |
[searchBar setSearchFieldBackgroundImage:[UIImage imageNamed:@"UI_searchbar.png"] forState:UIControlStateNormal]; | |
searchView.backgroundColor = [UIColor clearColor]; | |
for (UIView *subview in [[searchBar.subviews objectAtIndex:0] subviews]) { | |
subview.alpha = 0.0; | |
subview.backgroundColor = [UIColor clearColor]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment