07-19-2023, 01:06 AM
I want to be change the font of the title to Avenir, and I want to make it white. Here is my code in the `viewDidLoad` method:
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont(name: "Avenir", size: 20)!]
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
This code only changes the color of the title, not the font. Additionally, I tried implementing this in the App Delegate File, but that did not work.
Here is what my UINavigationBar looks like:[![enter image description here][1]][1]
[1]:
I want the title to have a font of Avenir as well. How do I achieve this?
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont(name: "Avenir", size: 20)!]
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
This code only changes the color of the title, not the font. Additionally, I tried implementing this in the App Delegate File, but that did not work.
Here is what my UINavigationBar looks like:[![enter image description here][1]][1]
[1]:
I want the title to have a font of Avenir as well. How do I achieve this?