My application has a navigation view controller with 2 views :
– a root view : i’d like the tint color for its navigation bar to be black
– a sub view : i’d like the tint color for its navigation bar to be blue
To achieve this, I set the tint color for the navigation bar in the viewDidLoad method of each view controller :
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
My problem is that during the tests :
– step 1 – i access the root view : the navigation bar is black : OK
– step 2 – i push the subview : the navigation bar is blue : OK
– step 3 – i click on the “back” button of the subview : the navigation remains blue : KO
Is there any add code I should add to obtain the behavior I want ?
(i’ve tried some dirty workarounds like calling drawRect in viewWillAppear but it does not work)
Thanks for your help !
You should be able to do the
self.navigationController.navigationBar.tintColor = [UIColor blackColor];inviewWillAppearorviewDidAppear