user1680822 user1680822 - 1 year ago 103
iOS Question

How to hide a status bar in iOS?

I can hide a status bar in my app:

- (void)viewDidLoad{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[super viewDidLoad];

When I chose my launch image and start it first time, it's status bar over a picture. How can I hide this?

Answer Source

Add the following code to your view controller:

if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
    // iOS 7
    [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
    // iOS 6
    [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];

- (BOOL)prefersStatusBarHidden {
    return YES;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download