1. Set the background color of the Navigationbar:
Self. Navigationcontroller. Navigationbar. Bartintcolor = [uicolor redcolor];
2. Set the title on the Navigationbar
Self. Navigationitem. Title = @ "Test";
< Span class= "S4" >3. Set the font size and color (using rich text) for headings on Navigationbar
Self. Navigationcontroller. Navigationbar. Titletextattributes = [nsdictionary Dictionarywithobjectsandkeys:[uicolor Yellowcolor],nsforegroundcolorattributename,[ uifont systemfontofsize:50 ],nsfontattributenamenil ];
< Span class= "S1" > < Span class= "S3" > 4. Setting Navigationbar background Image:
< Span class= "S3" > < Span class= "S1" > /span> [self. Navigationcontroller. Navigationbar setbackgroundimage:[UIImage< Span class= "S1" > imagenamed:@ "1" forbarmetrics:uibarmetricsdefault];
< Span class= "S1" > < Span class= "S3" > 5. Hide/Show back key
< Span class= "S1" > < Span class= "S3" > in the interface setting where the return key needs to be hidden:
< Span class= "S1" > < Span class= "S3" > /span> self. Navigationitem. Hidesbackbutton = no
6. Keep The return arrow, remove the return title or change to another title
Set in the push-in top-level interface:
Uibarbuttonitem *backitem = [[uibarbuttonitem alloc] init];
Backitem. title = @ ""; (Don't set an empty string for the title, just write the string in the other header)
Self. Navigationitem. Backbarbuttonitem = backitem;
7. Change the return key and title color
Self. Navigationcontroller. Navigationbar. Tintcolor = [uicolor whitecolor];
< Span class= "S3" >8. Custom Rightbutton
Method one: uibarbuttonitem *button= [[Uibarbuttonitem alloc] Initwithimage:nil style:u Ibarbuttonitemstyledone target:self Action: @selector (Action:)]; Self.navigation.rightBarButtonItem = button; Method Two: uibutton *button =[[Uibu Tton Alloc] Initwithframe:cgrectmake (0,0,30,30)]; [button setimage:[uiimage imagenamed:@ ""] forstate:uicontrolstatenormal]; [button addtarget:self action: @selector (action:) forcontrolevents:uicontroleventtouchupinside]; Uibarbuttonitem *rightitem = [[Uibarbuttonitem alloc] initwithcustomview:button]; self.navigationitem.rightbarbuttonitem = rightitem;
The use of Navigationcontroller and finishing