Pregunta

I'm building a sprite kit game, and normally status bar does not show within my app. However, the drag and drop code that I'm using is doing something with the window and when the item is being dragged, the status bar flickers on and off. So my question is:

How can I completely and utterly tell iOS7 to hide status bar everywhere within my app?

I tried plugging per controller code, but cannot seem to find which particular controller is showing the status bar.

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

I have status bar set to initially hidden in plist: enter image description here

I tried using setStatusBarHidden within appDidFinishLaunching

Maybe there's some centralized setting I can set to off?

¿Fue útil?

Solución

The setStatusBarHidden setting and the "Status bar is initially hidden" Info.plist setting do not work unless you also set the "View controller-based status bar appearance" Info.plist key (UIViewControllerBasedStatusBarAppearance) to "NO".

In other words, either you're doing this at the level of every single top-level view controller or you're doing it at the global UIApplication level, and this key determines which it is.

However, it is better to learn to do it the view controller way, because Apple might eventually take away the option to do it at the global UIApplication level.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top