status bar iOS 7

95 views Asked by At

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

There are 2 answers

0
Nazik On

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;
}
0
Robin Garg On

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.