As the other answers mention, you can use setTintColor:
, but you want a solid color and that's not possible to do setting the tint color AFAIK.
The solution is to create an image programmatically and set that image as the background image for all navigation bars via UIAppearance
. About the size of the image, I'm not sure if a 1x1 pixel image would work or if you need the exact size of the navigation bar.Check the second answer of this question to see how to create the image.
As an advice, I don't like to "overload" the app delegate with these type of things. What I tend to do is to create a class named AppearanceConfiguration
with only one public method configureAppearance
where I set all the UIAppearance stuff I want, and then I call that method from the app delegate.