iOS8之后searchbar cancel 变汉字取消

  • (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {
    searchBar.showsCancelButton = YES;
    for(id cc in [self.searchController.searchBar.subviews[0] subviews])
    {
    if([cc isKindOfClass:[UIButton class]])
    {
    UIButton *btn = (UIButton *)cc;
    [btn setTitle:@"取消" forState:UIControlStateNormal];
    }
    }
    NSLog(@"shuould begin");
    return YES;
    }

你可能感兴趣的:(iOS8之后searchbar cancel 变汉字取消)