My current application runs on iOS 5 and 6.
The navigation bar is having an orange color and the status bar is having a black background color with white text color. However, when I run the same application on iOS 7, I observe the status bar looks transparent with the same orange background color as the navigation bar and the status bar text color is black.
Due to this I'm not able to differentiate between the status bar and the navigation bar.
How do I make the status bar to look the same as it was in iOS 5 and 6, that is with black background color and white text color? How can I do this programmatically?
If you're using a
UINavigationController
, you can use an extension like this:It basically makes the navigation bar background transparent and uses another UIView as the background. You can call the
setNavigationBarBackground
method of your navigation controller to set the navigation bar background color together with the status bar.Keep in mind that you have to then use the
setNavigationBar(hidden: Bool, animated: Bool)
method in the extension when you want to hide the navigation bar otherwise the view that was used as the background will still be visible.