Enrico Susatyo Enrico Susatyo - 1 year ago 92
iOS Question

How do I change the colour of the status bar when the navigation bar is hidden in iOS 7?

I am aware of how to change the colour of a navigation bar (and status bar) by doing this:

self.navigationController.navigationBar.barTintColor = [UIColor redColor];

But when I hide my navigation bar, the status bar color reverts back to transparent color.

How do I keep the status bar color the same as the barTintColor even when the navigation bar is hidden?

Answer Source

Add a UIView under the status bar and set its backgroundColor property to the navigation bars barTintColor

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download