Remove Border of UISearchBar in iOS7

前端 未结 10 1677
死守一世寂寞
死守一世寂寞 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:25

    For Swift, these 2 lines are enough:

    self.search.isTranslucent = false
    self.search.backgroundImage = UIImage()
    

    And then, apply required color that you want:

    self.search.barTintColor = .red
    

提交回复
热议问题