By default, the style of the navigation bar Uinavigationcontroller is simpler if you want to use code to modify the style.
1, modify the navigation bar background color
Modify the navigation bar background color
Self.navigationcontroller? Navigationbar.bartintcolor =
Uicolor (red:55/255, green:186/255, blue:89/255, alpha:1)
2, modify the navigation bar text color
//Modify navigation bar text color
Self.navigationcontroller? Navigationbar.titletextattributes =
[nsforegroundcolorattributename: Uicolor.whitecolor ()]
3, modify navigation bar button Color
Regardless of the default button, or a custom button, colors are modified.
//Modify navigation bar button Color
Self.navigationcontroller? Navigationbar.tintcolor = Uicolor.whitecolor ()
4, modify navigation bar background picture
If the background picture does not need to extend to the status bar, the background picture height is 44 points (88 pixels).
If you want the navigation bar to be included in the background picture, the background picture height is changed to 64 dots (128 pixels).
Regardless of size, the setting code is as follows:
Self.navigationco Ntroller? Navigationbar
.setbackgroundimage ( UIImage (named: "Bg5"), Forbarmetrics:. Default)