如何更改导航栏中的后退按钮颜色?

4th*_*ace 11 uinavigationcontroller ios swift

有没有办法只使用导航控制器更改应用程序中的左侧后退按钮颜色?

在导航栏中有很多改变颜色的例子,但这些都会影响导航栏标题.我不想改变标题.只需后退按钮(文字+雪佛龙)颜色.

Bha*_*iya 23

使用下面更改后退按钮颜色:

self.navigationController?.navigationBar.tintColor = UIColor.redColor()
Run Code Online (Sandbox Code Playgroud)

更改导航栏的标题颜色使用:

self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.redColor()]
Run Code Online (Sandbox Code Playgroud)

  • 对后退按钮没有任何作用. (3认同)