View Above Status Bar

I am trying to get a view above the status bar in ios9:

UIWindow *statusWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; statusWindow.windowLevel = UIWindowLevelStatusBar + 1; statusWindow.hidden = NO; statusWindow.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.7]; [statusWindow setRootViewController:self]; [statusWindow makeKeyAndVisible]; 

I get only a black screen that does not display the status bar. Any idea why it is not working?

+1
ios objective-c
source share
2 answers

I found this: https://github.com/kevingibbon/KGStatusBar This works very well. This is the only structure I have found that works with iOS9.

0
source share

I am going to continue and assume that you are writing your code based on this thread:

Add a UIView over all other views, including the StatusBar

As the saying goes, why do you install:

 statusWindow.windowLevel = UIWindowLevelStatusBar + 1; 

It should be:

 statusWindow.windowLevel = UIWindowLevelStatusBar; 

In the future, add links to any topics you have looked at.

Good luck

+1
source share

All Articles