标签:io ar for sp on bs as tt ui
//点击搜索框时触发
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
{
self.theSearchUserSearchBar.showsCancelButton = YES; //很关键
UIView *topView = self.theSearchUserSearchBar.subviews[0];
for (UIView *searchbuttons in topView.subviews)
{
if ([searchbuttons isKindOfClass:NSClassFromString(@"UINavigationButton")])//NSClassFromString(@"UINavigationButton")
{
UIButton *cancelButton = (UIButton*)searchbuttons;
cancelButton.enabled = YES;
[cancelButton setTitle:@"确定" forState:UIControlStateNormal];
break;
}
}
return YES;
}
所以,同理可以更改 UISearchBar上面的任意view。
标签:io ar for sp on bs as tt ui
原文地址:http://www.cnblogs.com/Camier-myNiuer/p/4078128.html