iOS 7.1 UISearchBar gray view

折月煮酒 提交于 2019-11-28 12:38:18
Max Chuquimia

My quick fix used some code I found here: https://stackoverflow.com/a/18664917/1153630

And then:

searchBar.backgroundImage = [UIImage imageWithColor:[UIColor clearColor]];

I'm still not very impressed by it though: will update answer when I find a better way.

You may also want to checkout: Colour changed in iOS7.1, how to change searchBar colour?

As @dave noted above, you can just use say:

searchBar.backgroundImage = [[UIImage alloc] init];

which avoids the need for the category on UIImage incorporated in @Jugale's example.

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