Breaking News
Home / iOS / iOS Snippets / How do you set a background image in UINavigationBar in iOS?

How do you set a background image in UINavigationBar in iOS?

In order to set a background image for the navigation controller use the following code:

// get handle to nav bar

UINavigationBar *navBar = self.navigationController.navigationBar;

// get image
UIImage *image = [UIImage imageNamed:@”backgroundImageToSet.png”];

// set the bg image
[navBar setBackgroundImage:image];

in the viewWillAppear method.

– (void)viewWillAppear:(BOOL)animated

[pb_builder]

Check Also

Your IAPs are set to Consumable – App Rejection Reason

App Rejection Reason We found that the Purchasability Type for one or more of your …

Advertisment ad adsense adlogger