In the latest iOS, we can choose to hide bars on scroll in navigation controller. I have a navigation bar whose color is green and of course now the status bar color is also green. However, after navigation bar is hidden on scroll, the status bar becomes translucent. I want to keep it green as before, so what can I do? By the way, in info.plist, I have set status bar style as UIStatuBarStyleLightContent, but after navigation bar is hidden, it becomes black. Could you help me on this?
1
votes
"By the way, in info.plist, I have set status bar style as UIStatuBarStyleLightContent" Irrelevant. It is the view controller, not the Info.plist, that sets the color of the text in the status bar.
- matt
1 Answers
3
votes
The status bar is not green. The status bar is transparent. It may look green under some circumstances, but that is just because what is behind it is green.
Well, that green thing is the navigation bar.
If you take the navigation bar away, now the thing behind the status bar is not the navigation bar. And if what is now behind the status bar, whatever it is, is not green, a different color will now be showing through the status bar.
So, if you want the status bar always to look green, make sure that what is behind it is always something green. Personally, I think this is a silly thing to worry about, but if that's what you want, that's how to accomplish it.