iOS 7.1 UISearchBar gray view

前端 未结 2 1311
春和景丽
春和景丽 2020-12-11 07:51

I work at an application and I tested today on iOS 7.1. Until now my search bar was normal:

\"iOS

相关标签:
2条回答
  • 2020-12-11 08:22

    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.

    0 讨论(0)
  • 2020-12-11 08:40

    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?

    0 讨论(0)
提交回复
热议问题