iOS projects, depending on the design diagram, sometimes need to customize the background of the UIView Uinavigationbar. You can cut out a background image of about 1 pixels to act as a uinavigationbar background.
Can take advantage of Navigationbar-(void) SetBackgroundImage: (UIImage *) backgroundimage forbarmetrics: (uibarmetrics) The Barmetrics method fills the picture with the Navigationbar background.
The specific code can refer to:
[Self.navigationController.navigationBar setbackgroundimage:[uiimage imagenamed:@ "navbarbj [] forbarmetrics:uibarmetricsdefault];
One of the uibarmetricsdefault refers to the cell phone vertical direction of the navigationbar, another commonly used uibarmetricslandscapephone refers to the mobile phone landscape navigationbar.
Also on customizing the Back button, take Aview jump to bview for example.
One way is to customize a leftbarbuttonitem in the bview Navigationitem, which implements the return navigation operation. The code can refer to:
Uibarbuttonitem *barbuttonitemleft=[[uibarbuttonitem alloc] Initwithtitle:@ " back to home " Style:uibarbuttonitemstylebordered target:self Action: @selector (Navigationtomainview)]; [[Self Navigationitem] setleftbarbuttonitem:barbuttonitemleft];
One way is to set the return button custom style in Aview. The specific code can refer to:
Uibarbuttonitem *backitem=[[Uibarbuttonitem alloc]init]; Backitem.title=@ ""; Backitem.image=[uiimage imagenamed:@ ""];self.navigationitem.backbarbuttonitem=backitem;
iOS Development memo: Custom Uinavigationbar background picture and Back button