//设置seachbar的取消按钮
- (void)searchBarTextDidBeginEditing:(UISearchBar*)searchBar
{
[searchDisplayController.searchBarsetShowsCancelButton:YES];
for(idccin[searchBar.subviews[0]subviews])
{
if([ccisKindOfClass:[UIButtonclass]])
{
UIButton*btn = (UIButton*)cc;
[btnsetTitle:@"取消"forState:UIControlStateNormal];
[btnsetTitleColor:[UIColorwhiteColor]forState:UIControlStateNormal];
}
}
}
网友评论