Properties settings for the IOS navigation bar

Source: Internet
Author: User

Set the navigation bar background, font properties in iOS

---------------------------------------------------

1. Custom navigation controller as base class, set preferences in the + (void) Initialize method, do not set in the + (void) Load method

+ (void) Initialize {

Sets the color Tintcolor of the buttons on both sides (except the title)

[[Uinavigationbar appearance] settintcolor:fgcolor]; Fgcolor set the color of the return button Tintcolor (except for the title)

Navigation bar Background Color

[[Uinavigationbar appearance] setbartintcolor:bgcolor];

Title Property

[[Uinavigationbar appearance] settitletextattributes:@{

Nsforegroundcolorattributename:[uicolor colorwithrgbhex:0x333333],

Nsfontattributename: [Uifont systemfontofsize:18]

}];

Set navigation bar button text color (except title)

/*

Uibarbuttonitem *item = [Uibarbuttonitem appearance];

Nsdictionary *atts = @{

Nsforegroundcolorattributename: [Uicolor colorwithrgbhex:0xff0000]

};

[item Settitletextattributes:atts Forstate:uicontrolstatenormal];

*/

}

Properties settings for the IOS navigation 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.