I have a -as I hope- very simple question: how to disable an UISearchBar in IOS5 to avoid user interaction? I can't find setEnabled or something like this...
Thanks!
Have you tried:
[searchBar setUserInteractionEnabled:NO];
?
In addition to setting user interaction, I also adjusted the alpha value as well, to make the appearance unique.
searchbar.alpha = .75;
Try this
// Normal
self.searchDisplayController.searchBar.userInteractionEnabled = YES;
self.searchDisplayController.searchBar.translucent = YES;
self.searchDisplayController.searchBar.searchBarStyle = UISearchBarStyleDefault;
self.searchDisplayController.searchBar.backgroundColor = [UIColor clearColor];
// Faded out
self.searchDisplayController.searchBar.userInteractionEnabled = NO;
self.searchDisplayController.searchBar.translucent = NO;
self.searchDisplayController.searchBar.searchBarStyle = UISearchBarStyleMinimal;
self.searchDisplayController.searchBar.backgroundColor = [UIColor lightGrayColor];
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