UISearchBar barTintColor clearColor error in iOS 8.0

ⅰ亾dé卋堺 提交于 2019-12-05 18:24:48

I had the same problem in search bar so i changed the Search style from default to Minimal.

And it changed the bar style.

You can add a 1x1 pixel transparence image as background image to UISearchBar. It would be a dirty workaround. I think Apple should fix this issue.

You have to set UISearchBar tint color.

    UISearchBar *search=[[UISearchBar alloc]initWithFrame:CGRectMake(10, 20, 100, 20)];
    [search setBarTintColor:[UIColor clearColor]];
    search.backgroundImage=[UIImage new];
    self.navigationItem.titleView=search;

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!