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?
![Before[1]](https://i.stack.imgur.com/7mBL3.png)


Add a
UIViewunder the status bar and set itsbackgroundColorproperty to the navigation barsbarTintColor