IOS hidden navigation bar and status bar implementation method _ios

Source: Internet
Author: User

IOS hidden navigation bar and status bar implementation method

The height of the status bar is 20, the height of the navigation bar is 44, and if the navigation bar of the status bar is present, we typically set the position of the control on the view to be greater than or equal to 64.

One: Hidden navigation bar :self.navigationController.navigationBarHidden = YES;

Two: Hide the status bar:

Step One: Add two types (type) to the BOOL option in the Info.plist file, status bar is initially hidden set to Yes;view controller-based status bar Appeara NCE is set to No;

Step Two: Write code for the page where you want to hide the status bar: [uiapplication sharedapplication].statusbarhidden = YES;

In addition, it is worth saying that: the principle used to hide the status bar and the hidden navigation bar is the same as the nature, in a page a hidden, other related to his page B (such as Apush to B) of the status bar/navigation bar will also be hidden, if you do not want to hide a page of the status bar/navigation bars, You can write in Viewwillappear: (BOOL) animated [UIApplication Sharedapplication].statusbarhidden = no/ Self.navigationController.navigationBarHidden = NO;

Thank you for reading, I hope to help you, thank you for your support for this site!

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.