Hide Status Bar

Starting from iOS 7, there are 2 ways to hide the status bar. One is to hide the status bar in all view controllers, while the other is controller specific.

  1. App-based setting

Set “View controller-based status bar appearance” in target’s info to NO.

then in the app delegate, inside application:didFinishLaunchingWithOptions:, add

[application setStatusBarStyle:UIStatusBarStyleLightContent];
  1. Controller-based setting

Set “View controller-based status bar appearance” to YES.

Inside viewDidLoad, add

[self setNeedsStatusBarAppearanceUpdate]

and then add the following function:

-(UIStatusBarStyle)preferredStatusBarStyle{ 
    return UIStatusBarStyleLightContent; 
}
Hide Status Bar

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s