iPhone Development 101

iPhone 101

Code Tips

Resources

Links

Follow

Mailing ListTwitter

More

iPhone Development 101: User Interface: UINavigationController:
How to set the UINavigationBar's background image

In the navigation controller's root view controller, add this to the viewDidLoad method:

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

The image sizes should be:

  • navbar.png - 320 x 44
  • navbar@2x.png (retina) - 640 x 88

Additional References


TopHome