2

I have an app in which I set the UIStatusBarStyle to UIStatusBarStyleLightContent and it works perfectly fine for a while. Then, as suddenly than unexpectedly, it changes to UIStatusBarStyleDefault for no apparent reason.

View controller-based status bar appearance property is set to NO.

Is there a specific place which I should set the UIStatusBarStyle in? Currently I set it in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions before anything else.

Thank you very much for any clues.

user2006934
  • 171
  • 3
  • 11

1 Answers1

1

You have to set .plist file like :

enter image description here

write each view-controller :

-(UIStatusBarStyle)preferredStatusBarStyle
{
  if [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    return UIStatusBarStyleLightContent;// for black color 
  }else
  {
     return UIStatusBarStyleDefault;// set as default
  }
}

Hope it will help.

happy coding...

Community
  • 1
  • 1
Dhaval Bhadania
  • 3,090
  • 1
  • 20
  • 35