I am not able to clear search bar I have tried to make it clear by setting its background color clear and I have also placed one image under searchbar
I have also made clear background of searchbar
for (UIView *subview in self.searchBarHome.subviews) { if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) { [subview removeFromSuperview];//please help me to make clear background of uisearchbar break; } } [self.searchBarHome setBackgroundColor:[UIColor clearColor]];
From the control panel, select the search engine you want to edit. Click Look and feel from the menu on the left and then click the Themes tab. Select the theme you want to use. You can preview them in the box on the right.
For iOS7+, all you need to do is:
[self.searchBarHome setBackgroundColor:[UIColor clearColor]]; [self.searchBarHome setBarTintColor:[UIColor clearColor]]; //this is what you want
NOTE: This will not work for iOS6
For iOS6+, the following will take care of it even in iOS7:
[self.searchBarHome setBackgroundColor:[UIColor clearColor]]; [self.searchBarHome setBackgroundImage:[UIImage new]]; [self.searchBarHome setTranslucent:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With