I am trying to change the status bar style of one of my viewcontrollers. I have put this
2.
-(UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
[self setNeedsStatusBarAppearanceUpdate]
It works i.e I can see the font color white but just after some time it changes back to its previous type..
If you are experiencing status bar changing color itself during runtime
try setting set the UIViewControllerBasedStatusBarAppearance
to NO in the plist.
And inside your viewController.. set the appearance call inside
-(void)viewDidLayoutSubviews
{
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
[self setNeedsStatusBarAppearanceUpdate];
}
}