Like iOS 11, the status bar in my application is erroneous when I reject it. The background of the status bar becomes clear when the status bar is rejected. In iOS 10, this was not done.

I recreated the problem in a very simple application that I downloaded on Github: TestStatusBarBug . Here is all the relevant code:
AppDelegate.m
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UINavigationBar appearance] setBarTintColor:[UIColor grayColor]];
return YES;
}
@end
ViewController.m
#import "ViewController.h"
@interface ViewController () {
BOOL _statusBarHidden;
}
@end
@implementation ViewController
-(BOOL)prefersStatusBarHidden
{
return _statusBarHidden;
}
-(UIStatusBarAnimation)preferredStatusBarUpdateAnimation
{
return UIStatusBarAnimationSlide;
}
- (IBAction)toggleStatusBar {
_statusBarHidden = !_statusBarHidden;
[UIView animateWithDuration:0.35 animations:^{
[self setNeedsStatusBarAppearanceUpdate];
}];
}
@end
Has anyone else experienced this issue? Is there a fix or workaround?
source
share