Window with UIWindowLevelStatusBar + 1 hides status bar on iOS 8

I added a console window up in the status bar:

enter image description here

This works fine by setting its windowLevel to UIWindowLevelStatusBar + 1 prior to iOS 7.x (screenshot).

In iOS 8, the same code causes the status bar to disappear and shifts the navigation bars up. I tried several different window levels with no luck.

I use the library in many projects and notice that the status bar is displayed when the "PopUpWindow" level of the UIWindowLevelAlert also displayed. So one possible solution would be to add a layout there, but that would be dirty.

+6
source share
1 answer

Try implementing the -prefersStatusBarHidden method on the root view controller of your UIWindow. Worked for me.

+6
source

Source: https://habr.com/ru/post/976130/


All Articles