2

In my app i use ios 6 as deployment targer.

i set View controller-based status bar appearance to No in .Plist. status bar,s back ground color change to green as i want on ios 7. but when i run my app on ios 6 it remain black only when launch image is displayed rest is fine to whole app.

i use this code also in my app delegate...

if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
}
else
{
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}

How to change back ground of status bar background color and text color while launching the app on both ios 6 and ios 7.

user100
  • 327
  • 5
  • 19

3 Answers3

0

1) set the UIViewControllerBasedStatusBarAppearance to YES in the plist

2) in viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate];

3) add the following method:

 -(UIStatusBarStyle)preferredStatusBarStyle{ 
    return UIStatusBarStyleLightContent; 
 } 
Muruganandham K
  • 5,271
  • 5
  • 34
  • 62
  • i try it but in ios 6 the status bar is displaying black although it display green in ios 7 . my launch image has green color. – user100 Oct 22 '13 at 12:18
0

Because your navigation bar is translucent = YES which is default for iOS 7. Maybe, you also set translucent = YES for iOS 6. Set it to NO for iOS 6 so that it also works on app launch.

Sukhrob
  • 901
  • 4
  • 12
  • 34
0

In appdelegate.m put.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

    return YES;
}
Fudgey
  • 3,793
  • 7
  • 32
  • 53