Remove border between View and Search Bar

前端 未结 7 844
傲寒
傲寒 2020-12-17 14:54

So in Xcode I\'m trying to create a seamless search bar. So I\'m trying to replicate something like this

Note how the status bar is the same color as the s

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 15:04

    In Xcode 8.3 and Swift 3

    1. Create an outlet from your search bar to your ViewController (I called mine searchBarOutlet for this example).

    2. Below viewDidLoad insert the following.

      self.searchBarOutlet.backgroundImage = UIImage()

    You should have the following:

        override func viewDidLoad() {
        super.viewDidLoad()
    
             self.searchBarOutlet.backgroundImage = UIImage()
    

    When you run your app the lines will be gone (they will still be visible on storyboard).

提交回复
热议问题