Keller
Keller

Reputation: 17081

Change UINavigationBar Color for One View Controller

I have a navigation controller with a custom background navigation bar. I am using iOS 5's UINavigationBar "appearance" attribute to set the background image.

I am doing so in the applicationDidFinishLaunchingWithOptions app delegate method in order to change the background image across all nav bars. Trouble is, I need to change the navigation bar color to UIBarStyleBlackTranslucent for one single view controller.

How can I do this without having to go back and change every single view controller?

Upvotes: 3

Views: 1224

Answers (1)

Taylor Dondich
Taylor Dondich

Reputation: 658

Subclass the UINavigationController and have the popViewControllerAnimated method of your subclass reset the background image/color then call super's popViewControllerAnimated.

This assumes you are using a UINavigationController, which I think you are.

Upvotes: 0

Related Questions