// Set the style of the navigation bar
Self. navigationcontroller. navigationbar. barstyle = uibarstyledefault;
// Set whether the navigation bar is transparent, no transparency, yes transparency. The default value is yes;
// When the translucent attribute in the navigation bar is set to yes, the coordinate origin of the current view controller is in the upper left corner of the screen
// When the translucent attribute in the navigation bar is set to no, the coordinates of the current view controller are located in the upper left corner of the screen (the height from the Y axis to the navigation bar (44 ))
Self. navigationcontroller. navigationbar. translucent = no;
// Set the color of the element in the navigation bar
Self. navigationcontroller. navigationbar. tintcolor = [uicolor yellowcolor];
// Set the foreground color of the navigation bar
Self. navigationcontroller. navigationbar. bartintcolor = [uicolor cyancolor];
// Hide the navigation bar
Self. navigationcontroller. navigationbarhidden = no;
// Set the background image in the navigation bar
// Uibarmetricsdefault portrait (front screen)
// Uibarmetricslandscapephone Landscape Painting (side screen)
[Self. navigationcontroller. navigationbar setbackgroundimage: [uiimage imagenamed: @ "navbarbg1"] forbarmetrics: uibarmetricsdefault];
[Self. navigationcontroller. navigationbar setbackgroundimage: [uiimage imagenamed: @ "navbarbg2"] forbarmetrics: uibarmetricslandscapephone];
// Set the title view of the navigation item. The priority is higher than the following two methods.
Uiview * titleview = [[uiview alloc] initwithframe: cgrectmake (0, 0, 40, 40)];
Titleview. backgroundcolor = [uicolor purplecolor];
Self. navigationitem. titleview = titleview;
// Set the View Controller name
// The priorities set in the two methods are the same.
1 self. navigationitem. Title = @ "controllone ";
2 self. Title = @ "Controller 1 ";
// Place all the navigation element items in the navigationitem of the View Controller.
// All view controllers have their own independent navigation element items, but the public navigation bar
// Crop the part that exceeds the Boundary
Self. navigationcontroller. navigationbar. clipstobounds = yes;
Record some easily forgotten attributes-uinavigationcontroller