0

I have a tap bar that with 3 items. The first item is a UISplitView showing a UIViewController with a UITableView. The other two items are simple UIViewControllers embedded in a UINavigationController.

The two UIViewControllers embedded in a UINavigationController have a navigation bar with their title provided by the UINavigationController and "default" color.

I added a UINavigationBar to the UINavigationController in the first item but it has different color, it is white (Messages in the gif):

enter image description here

So I found out the default color of the UINavigationBar embedded in a UINavigationController and set it in code

navigationBar.barTintColor = UIColor(colorLiteralRed: (247/255), green: (247/255), blue: (247/255), alpha: 1)

The navigation bar changes color but the status bar remains white:

enter image description here

I tried the accepted answer from How to change Status Bar text color in iOS 7 but it did not help.

So how do I style the UINavigationBar in my view controller so it exactly matches the default one in navigation controller?

Community
  • 1
  • 1
Igor Kulman
  • 15,893
  • 10
  • 51
  • 114

1 Answers1

0

I think we worked together at Fuerte International a couple of years ago!

The status bar doesn't have a colour, it should just be the colour of your background view. Change the colour of that and you should see the status bar change too?

jakedunc
  • 946
  • 8
  • 20