Remove Border of UISearchBar in iOS7

前端 未结 10 1650
死守一世寂寞
死守一世寂寞 2020-12-24 10:46

I\'m trying to remove border of UISearchBar in iOS 7. In iOS 6 it\'s working fine. I created the UISearchBar programatically. I tried almost every thing from Stack Overflow

10条回答
  •  执笔经年
    2020-12-24 11:06

    Neither only barTintColor, backgroundImage nor backgroundColor alone were doing it for me, but doing them all together worked for me:

    self.searchBar.translucent      = NO;
    self.searchBar.barTintColor     = [styleManager currentSearchBarTintColor];
    self.searchBar.backgroundImage  = [UIImage new];
    self.searchBar.backgroundColor  = [styleManager currentSearchBarTintColor];
    

提交回复
热议问题