Uitabbarcontroller the following often need to set the navigation bar style for multiple viewcontroller, summed up the experience of adding a background image for the Uinavigationbar several simple ideas to set the background image as an example: the first kind, Set the Uinavigationbar of each view directly in the view, for each page requires a different navigation bar style. [Self.navigationController.navigationBar setbackgroundimage:[uiimage imagenamed:@ "nav_bg_all-64"] forbarmetrics: Uibarmetricsdefault]; the second type: Create a common basenavigationcontroller for each page and set up a background image. The other view controller inherits it, which can also achieve a holistic setting effect. [Self.navigationbar setbackgroundimage:[uiimage imagenamed:@ "nav_bg_all-64"] forbarmetrics:uibarmetricsdefault]; Third, write a method in Tabbarcontroller that is set by traversing the navigation bar of all views. Remember to call this method-(void) createnavigationbar{//traverse all views of the navigation bar for (Uinavigationcontroller *navi in self.viewcontrollers) {[ Navi.navigationbar setbackgroundimage:[uiimage imagenamed:@ "nav_bg_all-64"] forbarmetrics:uibarmetricsdefault];}} Fourth: Directly change the default style of the Uinavigationbar, which differs from the previous one in that it only changes the navigation bar of the five views, while the latter acts on Uinavigationbar. [[Uinavigationbar appearance] Setbackgroundimage:[uiimage imagenamed:@ "nav_bg_all-64"] forBarMetrics: Uibarmetricsdefault];
Some simple ideas of ios-uinavigationbar adding background picture