iOS 改变搜索框取消按钮的标题
#pragma mark - UISearchBarDelegate 搜索框的代理方法
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
[searchBar setShowsCancelButton:YES animated:YES];
for (id obj in [searchBar.subviews[0] subviews]) {
if ([obj isKindOfClass:NSClassFromString(@"UINavigationButton")]) {
UIButton *cancleButton = (UIButton *)obj;
[cancleButton setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。