First, the hierarchical relationship: Leftbarbuttonitem, Rightbarbuttonitem, title are added on the Uinavigationitem, Uinavigationitem added on the Navigationbar, Navigationbar corresponds to the unique navigationcontroller.
1. Set the background color of the navigation bar Navigationbar:
Set after creating Uinavigationcontroller in Appdelegate
(1.) Setbartintcolor: Setting the color of the Nagivationbar can also be used:
[[Uinavigationbarappearance] setbartintcolor:[uicoloryellowcolor]];(in
Uinavigationcontroller execution Pushviewcontroller The interface again setbartintcolor after the color will change, indicating that the same uinavigationbar is set,)
(2) Modify Navigationbar color with Self.navigationController.navigationBar.barTintColor in sub-set
* Remark *//
[Uinavigationbar appearance] method can only be used in Appdelegate, The properties of Nagivationbar can only be modified by Self.navigationcontroller in Uinavigationcontroller's child pages.
(3.) Settintcolor: Set the color of the button on the Nagivationbar:
Self.navigationController.navigationBar.tintColor = [Uicolorbluecolor];
2. Set the color and properties of title on Navigationbar
(1.)
[[Uinavigationbar appearance] Settitletextattributes:@{nsforegroundcolorattributename:[uicolor WhiteColor ]}];
(2.)
[Self.navigationController.navigationBar Settitletextattributes:@{nsforegroundcolorattributename:[uicolor Whitecolor]}];
Also, the knowledge point about the return button:
Set the Back button for the next interface in the previous interface: Self.navigationItem.backBarButtonItem
When you switch to the next view using Pushviewcontroller, the navigation controller changes the left button of the navigation bar in the following 3 order:
1. If b view has a custom left button (Leftbarbuttonitem), the custom button will be displayed;
2. If B does not have a custom button, but the Backbarbuttonitem property of a view has a customization, the customization is displayed;
3, if none of the first 2, then the default display a Back button, the title of the Back button is a view of the title;
iOS navigation bar Navigationbar colors, buttons and captions, and font colors