IOS _ hide the top Status Bar

Source: Internet
Author: User

IOS _ hide the top Status Bar

Comparison between iOS6 and iOS7 in hiding Status Bar:



Storyboard

Select UIViewController on the page, and the Simulated Metrics on the rightmost shows that the Status Bar is set to None.



ViewController

IOS 6
Use [UIApplication sharedApplication] to obtain the app Singleton, and then call the setStatusBarHidden method to hide the Status Bar.

UIApplication *app = [UIApplication sharedApplication];[app setStatusBarHidden:YES withAnimation:YES];


IOS 7

Implement the prefersstatusbarhidmethod and return YES
-(BOOL) prefersStatusBarHidden {return YES;} // in special cases, call the following method to force re-paint the ready Status Bar [self setNeedsStatusBarAppearanceUpdate];



Info. plist


IOS 6
Add the Status bar is initially hidden row to Info. plist and set the value to YES.

IOS 7

In addition to adding a row of Status bar is initially hidden in Info. plist, select YES,

You also need to add a row of View controller-based status bar appearance, with the value set to NO.





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.