1

For some reason, when I use popViewControllerAnimated to return to a previous view, the tint of the UIBarButtonItem turns grey, rather than the desired purple color (which is set in the storyboard).

Is there a way to refresh the navigationBar within the viewWillAppear method? I've tried using [self.navigationController loadView];, but that causes other issues and prevents the view from loading.

Birrel
  • 4,754
  • 6
  • 38
  • 74

1 Answers1

0

You could change it back programmatically.

-(void)viewWillAppear
{
UIColor *color = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
myNavController.navigationBar.tintColor = color;
}

Use http://www.rapidtables.com/web/color/RGB_Color.htm to find a color.

jakesan700
  • 56
  • 9
  • No dice. Tried `UIColor *color = [UIColor purpleColor]; UINavigationController *myNavController = self.navigationController; myNavController.navigationBar.tintColor = color;` and nothing changed. – Birrel Jun 28 '14 at 21:53
  • In the `viewWillApear` method? – jakesan700 Jun 28 '14 at 22:17
  • Yes. I have a few other settings (initializations) that I handle in the same method. None that deal with appearance, and none that interfere with the tint. This is something else... – Birrel Jun 28 '14 at 22:48
  • Please see my code [here](http://stackoverflow.com/questions/24470951/objective-c-button-tint-changes-color-when-using-popviewcontrolleranimated). I posted this question as a follow-up to the question in the link, because I had solved one of the two issues in that particular thread. – Birrel Jun 28 '14 at 23:26
  • Got it! Please see **Edit #2** in **[this](http://stackoverflow.com/questions/24470951/objective-c-button-tint-changes-color-when-using-popviewcontrolleranimated)** thread for the solution. The problem stemmed from calling the `popViewControllerAnimated` before the view had finished loading. – Birrel Jun 29 '14 at 00:01