0

I have an iOS app that uses a custom back chevron for the back button in navigation bars with custom background colors and shadows and such. I'd like to set the color of that back indicator image to something besides the default blue. How do I do that with the new UINavigationBarAppearance APIs?

I have tried:

  • Setting the back indicator image to a template image of my shape - this works, but doesn't affect the color.
  • Setting titleTextAttributes on the normal variant of the buttonAppearance, specifying NSForegroundColorAttributeName
  • Setting titleTextAttributes on all variants of the backButtonAppearance, specifying NSForegroundColorAttributeName and NSBackgroundColorAttributeName
  • Setting tintColor on the navigation bar directly - this affects the back indicator during animation of a new navigation item, but at the end of the animation it goes back to blue.
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145

1 Answers1

1

The tintColor works for me. The attached screencast shows (using slow animations) that having set the tint color to black, it stays black, both pushing and popping:

enter image description here

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Tint color worked for me too, on trying it again. I might have been setting it before calling one of the `configure` methods on my appearance object, which might have overridden it. – Tom Hamming Oct 08 '19 at 19:25
  • Yes, the interplay between the new stuff and the old stuff is tricky. In addition, there are huge holes in the new stuff (as you have illustrated), so you're forced back on the old stuff. – matt Oct 08 '19 at 19:39
  • looks like I should file a radar. – Tom Hamming Oct 08 '19 at 20:16