修改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];
        }
    }
}

posted on 2012-07-26 16:32  小浪鼓  阅读(2416)  评论(0编辑  收藏  举报

导航