IOS navigation bar and status bar color-related settings __ios

Source: Internet
Author: User
Local navigation bar color settings
Set navigation bar color
    self.navigationController.navigationBar.barTintColor = [Uicolor colorwithred:78.0/255 Green : 238.0/255 blue:218.0/255 alpha:1.0];

Set navigation bar text color white
 self.navigationController.navigationBar.titleTextAttributes = @{nsforegroundcolorattributename : [Uicolor Whitecolor]};

Set button text color white
self.navigationController.navigationBar.setTintColor = [Uicolor Whitecolor]];
Global navigation bar color settings
* *
//Set navigation bar color in APPDELEGATE.M
[[Uinavigationbar appearance] Setbartintcolor:[uicolor colorwithred : 78.0/255 green:238.0/255 blue:218.0/255 alpha:1.0]];

Set navigation bar text color white
[[Uinavigationbar appearance] Settitletextattributes:@{nsforegroundcolorattributename:[uicolor Whitecolor]}];

Set button text color white
[[Uinavigationbar appearance] Settintcolor:[uicolor Whitecolor]];

Set navigation bar button font size
[[Uibarbuttonitem appearance] Settitletextattributes:[nsdictionary Dictionarywithobjectsandkeys : [Uifont boldsystemfontofsize:15], Uitextattributefont,nil] forstate:uicontrolstatenormal];
Change status bar color white

===============2015.11.22=================
Suddenly found in the general inside the adjustment Statusbarstyle can, this can also solve the Launchscreen.storyboard status bar color black problem.

==================old===================
* First add a uiviewcontrollerbasedstatusbarappearance in the Info.plist, the value is no
* Then write the following statement in the program

[[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; 
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.