Reputation: 445
I have a navigation bar whose tint color is set, but when I navigate to other screen it looks bit different like in lighter than previous one..any idea why it is happening..how to fix this
Upvotes: 3
Views: 6792
Reputation: 11
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
Upvotes: 0
Reputation: 2201
In Story Board select navigation Bar and change bar tint color
in image display with red mark.
Upvotes: 1
Reputation: 336
If you are using the same Navigation controller for all the ViewControllers in your project, then you need to set the tint colour in AppDelegate.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UINavigationBar.appearance().barTintColor = colorToSet
// colorToSet is an object of UIColor
return true
}
Upvotes: 0
Reputation: 6795
Add this code to your rootViewController
override func viewWillAppear(_ animated: Bool) {
navigationController?.navigationBar.barStyle = UIBarStyle.default
navigationController?.navigationBar.tintColor = UIColor.black
}
Upvotes: 1