Nick ONeill Nick ONeill - 4 months ago 19
iOS Question

iOS 7 Fade status bar text in and out?

I know it's possible to remove a status bar, however the frame shifts up by the height of the status bar if you set it to hidden. As such, the following code:

[UIApplication sharedApplication].statusBarHidden = YES;


is not sufficient for just hiding the text of the status bar. What I'm ultimately attempting to accomplish here is something similar to the Gmail app in which as the side-menu is displayed, the status bar text is hidden, and then once a selection is made the frame returns to normal with the status bar text displayed.

This question shows how to animate the hiding of the status bar but the result is that the entire window shifts up by the height of the status bar. I'm trying to avoid that from happening.

Answer

Objective-C version:

[AppDelegate instance].window.windowLevel = UIWindowLevelStatusBar;

Swift version:

AppDelegate().window!.windowLevel = UIWindowLevelStatusBar
Comments