Ios_ Hide Top status bar

Source: Internet
Author: User

IOS6 and iOS7 in the hidden Status Bar three ways comparison:



Storyboard

The interface is selected Uiviewcontroller, the rightmost simulated metrics find Status Bar set to None



Viewcontroller

IOS 6
Get the app's singleton through [UIApplication Sharedapplication]. Then call the Setstatusbarhidden method to hide the Status Bar.



UIApplication *app = [UIApplication sharedapplication]; [App Setstatusbarhidden:yes Withanimation:yes];


IOS 7

implement the Prefersstatusbarhidden method and return YES
-(BOOL) prefersstatusbarhidden{    return YES; Special case, call the following method to force another paint Status bar[self setneedsstatusbarappearanceupdate];



Info.plist


IOS 6
Add the Status bar is initially hidden row in Info.plist and select YES.

IOS 7

Not only to add the Status bar is initially hidden row in info.plist , select the value YES,

You also need to add the View controller-based status bar appearance row and select the value NO.





Ios_ Hide Top status bar

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.