修改UISearchDisplayController 的Search Bar上“Cancel”按钮的文字
- (void) searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller { [searchBar setShowsCancelButton:YES]; for (UIView *v in searchBar.subviews) { if ([v isKindOfClass:[UIButton class]]) { [(UIButton *)v setTitle:@"返回" forState:UIControlStateNormal]; } } }