Search code examples
iosios8uiwindowuistatusbar

Window with UIWindowLevelStatusBar + 1 hides status bar on iOS 8


I have been adding a console window on top of the status bar:

enter image description here

This has been working great by setting its windowLevel to UIWindowLevelStatusBar + 1 up to iOS 7.x (screenshot).

On iOS 8 the same code makes the status bar disappear and offsets navigation bars up. I tried several different window levels with no luck.

I use the library on many projects and noticed that the status bar does show up when a "PopUpWindow" of level UIWindowLevelAlert is also shown. So one possible solution would be to add a mock window there but that would be plain dirty.


Solution

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