9

In my AppDelegate I use UIAppearance to set my own NavigationBar with this code :

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav5.png"] forBarMetrics:UIBarMetricsDefault];

But some views of my application don't need it. How can I get rid of it so I may only use IB in concerned views ?

Rob
  • 15,732
  • 22
  • 69
  • 107

1 Answers1

12

You don't need to use the proxy. Just get the actual navigationBar, which should look different and set the colors directly on it.

[navigationBarInstance setTintColor:[UIColor blackColor]];
[navigationBarInstance setBackgroundImage:[UIImage imageNamed:@"nav5.png"] forBarMetrics:UIBarMetricsDefault];

You can also just set both values to nil, where you want the standard styles again. (tested by Ben Clayton).

[navigationBarInstance setTintColor:nil];
[navigationBarInstance setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
calimarkus
  • 9,955
  • 2
  • 28
  • 48