I wish to change the title of the cancel button in iOS. I have been using this previously:
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayCon
simply do this code for it:-
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
/* when user start editing in serchbar this method will display cancel button and disable the autocorrection functionality */
srcbar.showsCancelButton = YES;
for (UIView *subView in searchBar.subviews) {
if ([subView isKindOfClass:[UIButton class]]) {
UIButton *cancelButton = (UIButton*)subView;
[cancelButton setTitle:@"hi" forState:UIControlStateNormal];
}
}
srcbar.autocorrectionType = UITextAutocorrectionTypeNo;
}
Not test in iOS7 but this working fine in iOS6 hope this working for you.
OUTPUT IS:-