I have a storyboard based app with a navigation controller as the initial view controller.
I would like to set the background for the navigation bar to an image using the setBackgroundImage:forBarMetrics: method, but I am unsure of where to call it.
I could subclass the UINavigationController and use the viewDidLoad method to call it, but subclassing UINavigationController is discouraged. I guess I should subclass UINavigationBar and override some initialisation method?
Thanks,
Steve
I’ve worked this one out myself. I wanted all navigation bars throughout the app to have the custom background, so the easiest way to do this seems to be using the appearance proxy for the navigation bar:
This will set the background image of all navigation bars to be “title_bar.png”.
It would seem a good place to do this sort of customisation is in the:
method in your application delegate.