Set the status bar color in iOS6

Source: Internet
Author: User

In iOS6, The statusbar color is determined by the UINavigationBar of the current page, that is, the UINavigationBar in the current view determines the tintColor of statusbar. If our UIViewController is a subset of UINavigationController, the color of statusbar is fine. If the UINavigationBar is dropped by hide or there is no UINavigationController at all, the color of statusbar on iOS6 is black.

What should we do? How can we set the statusbar color on iOS6?
As mentioned earlier, the color of statusbar is determined by UINavigationBar. Can we set a UINavigationBar in the current view to affect the color of statusbar. Our assumptions are correct. This method is indeed feasible.

Put a UINavigationBar in our view and set its frame = CGRectMake (0,-43,320, 44 ); here, the value of y must be-43 (The UINavigationBar has a pixel value), otherwise it will not achieve the same effect.
In this way, the expected result is displayed.

 

 

 

 

 

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.