Search code examples
iosstatusbarcolor-picker

Set Statusbar color to same as Nav Bar


I want the Status Bar of my app to have the exact same color as my Navigation Bar. The way I found to change the color of the Status Bar was just by creating a view in the size of the Status Bar and change the background color.

However even though I use the color picker from the Nav bar to set the color of the view I get 2 totally different colors as seen in the picture below. enter image description here

I've tried mixing with the color picker, changing opacity etc, however I'm never able to hit the correct color. Any ideas on how I can get the exact same color for the status bar?


Solution

  • The color of the UIStatusBar is automatically set to match the color of the UINavigationBar when you set the value of self.navigationController.navigationBar.barTintColor. Is there a reason you need to set them separately?