Enrico Susatyo Enrico Susatyo - 8 months ago 57
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