0

I was creating my own custom UISearchBar and UISearchController, following this tutorial and I wanted to add my own background using searchBar.setBackgroundImage() but the problem is that the image doesn't span the status bar as well. So I get a white status bar that looks like this:

enter image description here

Anyone know how to fix this?

JoeVictor
  • 1,806
  • 1
  • 17
  • 38

3 Answers3

1

enter image description here

your give link project implemented:

first go to main.storyboard delete constraint of tableview top after set tableview y position = 0 and set top constraint of tableview.

your search bar view height set in viewcontroller.swift file.

Bhadresh Kathiriya
  • 3,147
  • 2
  • 21
  • 41
  • Can you elaborate on the part where you set the search bar view height in the viewcontroller.swift file? How do I push the search bar, and all the stuff down? – JoeVictor May 26 '16 at 09:16
  • find you are set frame for search view and set height. or doesn't set your height default = 50. – Bhadresh Kathiriya May 26 '16 at 09:26
0

Try this:

UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
AkBombe
  • 638
  • 4
  • 10
-3

Set imageview "top space to superview" = -20.

Thanks

ranjit.x.singh
  • 307
  • 4
  • 9