导读:今天做一个搜索,结果出现了一层背景,要去除这层背景,然后翻笔记找到以前的方法for (UIView *subview in searchBar.subviews){if ([...
今天做一个搜索,结果出现了一层背景,要去除这层背景,然后翻笔记找到以前的方法
for (UIView *subview in searchBar.subviews)
{
if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")])
{
[subview removeFromSuperview];
break;
}
}
发现不能用了
怎么办,大神在这里:
这是在一贴吧上找到的
同时感谢这位名为“ ios小菜鸟”的开发者
[[[searBar.subviews AtIndex:0].subviews AtIndex:0]removeFromSuperview];
地址:http://www.cocoachina.com/bbs/read.php?tid-256550-page-2.html