StanLe
StanLe

Reputation: 5157

iPhone App - status bar hidden

I want to have the status bar in my iPhone app hidden for the launch image, and then I want to add it after. So in my app delegate, I did the following:

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

    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];

    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

    return YES;
}

But now, in my main controller, the status bar blocks part of the navigationController at the top of the app. The app thinks the status bar isn't there, or something.

So, how can I have the launch image not include the status bar, but then add the status bar right after, and keep the status bar there for the rest of the app?

Upvotes: 2

Views: 3387

Answers (2)

user1882026
user1882026

Reputation:

   [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];

Upvotes: 0

GendoIkari
GendoIkari

Reputation: 11914

In your info.plist file, there's a setting called "Status bar is initially hidden." Set that to "YES," and you won't have it at startup. Then you don't need to do anything in your code, the bar will show up when your app is launched.

Upvotes: 4

Related Questions