5

I want to design my navigation bar in IOS7 and i use this code.

  UIImage *navBackgroundImage = [UIImage imageNamed:@"navbar"];

    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav_bg.png"] forBarMetrics:UIBarMetricsDefault];

But my status bar is not displayed(Please see the picture). I use this code in 2 project but other project is ok. I dont know what i am doing wrong Please help me.

This result I dont want

enter image description here

This status bar is correct.

enter image description here

Gabriele Petronella
  • 102,227
  • 20
  • 204
  • 227
tommy
  • 292
  • 4
  • 15

1 Answers1

2

In Info.plist set 'View controller-based status bar appearance' as NO

In AppDelegate add

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
  [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}  

This solution works for iOS 7

Gabriele Petronella
  • 102,227
  • 20
  • 204
  • 227
tommy
  • 292
  • 4
  • 15