The navigation bar in iOS 6 looks like a bar in iOS 7

Is there a way to make the navigation bar items (back button) in iOS 6 look like the navigation bar items in iOS 7? As well as buttons and other elements of the iOS 7 user interface.

+7
ios6 ios7 uinavigationbar
source share
2 answers

Instead of injecting code into each view controller that you need to customize, I would recommend doing this for the entire application by putting something like this in your application:didFinishLaunchingWithOptions: method in the App Delegate of the application

 // Nav bar [[UINavigationBar appearance] setBackgroundImage:[[UIImage imageNamed:@"navBar.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 5, 10, 5)] forBarMetrics:UIBarMetricsDefault]; // Back buttons [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"backNavButton.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; // Toolbar [[UIToolbar appearance] setBackgroundImage:[[UIImage imageNamed:@"toolbar.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 5, 10, 5)] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault]; 
+8
source share

You can customize the navigation bar by setting the background image as follows

 [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"topbar.png"] forBarMetrics:UIBarMetricsDefault]; 

And you can add a customization panel using the setLeftBarButtonItems method like this.

 [self.navigationItem setLeftBarButtonItems:]; 
0
source share

All Articles