PopKernel
PopKernel

Reputation: 4260

statusBarStyle not changing?

The gist of this question is pretty straightforward. I'm trying to set the statusBarStyle of my UIApplication to UIStatusBarStyleLightContent in application:didFinishLaunchingWithOptions: (pictured below) but for some reason the value isn't sticking.

 NSLog(@"%ld",[[UIApplication sharedApplication]statusBarStyle]); //logs 0
 [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
 NSLog(@"%ld",[[UIApplication sharedApplication]statusBarStyle]); //logs 0

My only guess as to the problem is that it might have something to do with my usage of UIPageViewController, set as the root view controller in this case.

[self.window setRootViewController:self.pageViewController];

Upvotes: 0

Views: 178

Answers (2)

Sean
Sean

Reputation: 21

try setting set the UIViewControllerBasedStatusBarAppearance to NO in the plist.

Then in your viewController..

-(void)viewDidLayoutSubviews
{
    if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
        [self setNeedsStatusBarAppearanceUpdate];
    }
}

Upvotes: 2

ppalancica
ppalancica

Reputation: 4277

Try to go to the .plist file of your project, and add/set the key:

"View controller-based status bar appearance" to NO.

Upvotes: 1

Related Questions