Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS 7 status bar is not displayed? [duplicate]

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

like image 827
tommy Avatar asked Nov 01 '22 10:11

tommy


1 Answers

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

like image 56
tommy Avatar answered Nov 08 '22 05:11

tommy