0

I have a Home viewController, and it's linked to another viewController via Segue animation (so I have also linked the home ViewController to a NavigationContoller). In the Home Viewcontroller, I have changed the title text to orange, but when I click the button that triggers the segue and then come back to the Home ViewController, the title changed color.

Home ViewController in its normal state - Back button clicked in the next view and back to Home ViewController

edoriggio
  • 331
  • 3
  • 18

1 Answers1

1

Since you did not show the code, I don't know what is wrong with it. But here's how I always do it and it works:

Go to your storyboard file and select "Navigation Bar" under "Navigation Controller Scene" in the hierachy thingy:

enter image description here

Go to the Property Inspector on the right and find this item:

enter image description here

Set it to the desired color!

Sweeper
  • 213,210
  • 22
  • 193
  • 313
  • This is the code I used `self.navigationController?.navigationBar.barTintColor = UIColor.white self.navigationController?.navigationBar.isOpaque = true navigationController?.navigationBar.setBackgroundImage(UIIma‌​ge(), for: UIBarMetrics.default) navigationController?.navigationBar.shadowImage = UIImage() navigationController?.navigationBar.tintColor = color self.navigationController!.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.orange]` @Sweeper – edoriggio Dec 11 '16 at 21:01
  • @edoriggio I would try to put the above code in `viewDidAppear`. If that doesn't work, try the approached I described in the answer. – Sweeper Dec 11 '16 at 21:02
  • @edoriggio Don't post a bunch of code into a comment. You should provide that information in your question. – rmaddy Dec 11 '16 at 21:10
  • @rmaddy Yea, thanks for the tip, sorry but I am new here ... :) – edoriggio Dec 11 '16 at 21:11