Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change back button color in nav bar?

Is there a way to change only the left side back button color in an app with a navigation controller?

There are plenty of examples changing colors in the navbar but those all affect the navbar title as well. I don't want to change the title. Just the back button (text + chevron) color.

like image 509
4thSpace Avatar asked Apr 23 '16 04:04

4thSpace


People also ask

How do I change my navigation bar background?

In order to change the hub navigation bar color, we can go to site settings of hub site>Change the look>under the header section>Background> select a theme color to change the background color of your site header.

How do I change the navigation button color in Swift?

There is no way to do this in SwiftUI; you need to use UIKit methods to achieve it.


1 Answers

Use Below To Change Back Button Color:

self.navigationController?.navigationBar.tintColor = UIColor.redColor()

To Change Title Color of The Navigation Bar Use:

self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.redColor()]
like image 191
Bhargav Kukadiya Avatar answered Sep 18 '22 19:09

Bhargav Kukadiya