Display and hide of status bar in IOS program

Source: Internet
Author: User

Project sometimes need to be the top of the status bar to hide, search on the internet basically can not be used, the reason is probably when the program is running when the status bar has been displayed, and then adjust the status bar of the Set method will not work (as to why not work is not clear).

Hide the status Bar Method 1:

Modify the Plist file to add the Status bar is initially hidden when the setting is Yes, the program is hidden when it starts (the startup page does not appear)

Add view controller-based status bar appearance set to No

This modification hides the status bar in the entire project (Note: Celan program shift+command+k after plist file)

Hide the status bar Method 2:

You can adjust the following method in the interface that you need to hide

-(BOOL) Prefersstatusbarhidden {
return YES;
This can be hidden in the current interface. (Note: If the status bar in the entire project is hidden, the method will not be triggered)

Display and hide of status bar in IOS program

Related Article

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.