1
votes

I want to hide status bar in splash screen and show to viewController with white color.

I have done followings for this:

  1. Added "Status bar is initially hidden" to YES in info.plist.

  2. In –(BOOL)application:didFinishLaunchingWithOptions: method I have added [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

But still the status bar content is in black color.
Can anyone please help me to change the status bar content color to white?

2
you may need to implement the –preferredStatusBarStyle method in your view controllers.holex

2 Answers

3
votes

You need to Set "View controller-based status bar appearance” to YES in your info.list file.

And then in your Particular view controller,

- (UIStatusBarStyle)preferredStatusBarStyle
{
   return UIStatusBarStyleLightContent;
}
1
votes

I am agreed with NAZIK answer. But make sure if you are using Navigation Controller as window's root view controller then preferredStatusBarStyle doesn't work. As it will never be called by operating system. In that case after setting View controller based status bar appearance to NO in info.plist

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 

will work fine.