别说话,直接上代码
for (id obj in [searchBar subviews]) {
if ([obj isKindOfClass:[UIView class]]) {
for (id obj2 in [obj subviews]) {
if ([obj2 isKindOfClass:[UIButton class]]) {
UIButton *btn = (UIButton *)obj2;
[btn setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
}