怎么改变uisearchbar中的cancel按钮的文字
2个回答
推荐于2016-08-18 · 知道合伙人软件行家
关注
展开全部
改变uisearchbar中的cancel按钮的文字如下:
在以下这个代函数里面,遍历就可以了
- (void)searchBarTextDidBeginEditing:(UISearchBar *)hsearchBar
{
searchBar.showsCancelButton = YES;
for(id cc in [searchBar subviews])
{
if([cc isKindOfClass:[UIButton class]])
{
UIButton *btn = (UIButton *)cc;
[btn setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
在以下这个代函数里面,遍历就可以了
- (void)searchBarTextDidBeginEditing:(UISearchBar *)hsearchBar
{
searchBar.showsCancelButton = YES;
for(id cc in [searchBar subviews])
{
if([cc isKindOfClass:[UIButton class]])
{
UIButton *btn = (UIButton *)cc;
[btn setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
展开全部
有办法 在 这个代函数里面 遍历就可以了 - (void)searchBarTextDidBeginEditing:(UISearchBar *)hsearchBar
{
searchBar.showsCancelButton = YES;
for(id cc in [searchBar subviews])
{
if([cc isKindOfClass:[UIButton class]])
{
UIButton *btn = (UIButton *)cc;
[btn setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
{
searchBar.showsCancelButton = YES;
for(id cc in [searchBar subviews])
{
if([cc isKindOfClass:[UIButton class]])
{
UIButton *btn = (UIButton *)cc;
[btn setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询