Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why statusbar turns to black when UIView is embedded in NavigationalViewController in iOS 7?

In iOS 7, statusbar should be transparent by default. I am making an app which is using tabs. One tab is showing a simple UIView. I want white statusbar so i just put my view background white and it worked fine. Second tab' view is embedded in Navigational Controller. I set second view's background as white as well. But my statusbar becomes black. And i can't see anything except battery sign. Looks like following images:

Simple view statusbar: enter image description here

View Embedded in Navigational Controller statusbar: enter image description here

I want white statusbar in my whole app. Any idea why is it happening and how can i fix that. Thanks in advance.

like image 251
Piscean Avatar asked Sep 21 '13 09:09

Piscean


1 Answers

In the app delegate try:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

Are any of your VC's modal, as above seems ineffective on modal VC's.

like image 130
Aardvark Avatar answered Oct 10 '22 08:10

Aardvark