I have a UISearchDisplayController and UISearchBar hooked up to my ViewController via Outlets from my nib.
I\'d like to hide the cancel button so that the user never
If the cancel button shows up when editing the search field of the search bar you could do the following; subclass the search bar and have it implement the UITextFieldDelegateprotocol:
@interface CustomAlignedSearchBar : UISearchBar
Then implement textFieldDidBeginEditing: and do something like:
- (void)textFieldDidBeginEditing:(UITextField *)textField{
[self setShowsCancelButton:self.cancelButtonShown animated:NO];
}
This will make sure that the cancel button will not show up.