0

I am currently experiencing the problem that the readability of my navigationTitle("Gratitude Journal") is bad. Can someone help me figure out how to change it?

.foregroundColor does not work.

enter image description here

Thanks!

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
  • 1
    Does this answer your question? [SwiftUI update navigation bar title color](https://stackoverflow.com/questions/56505528/swiftui-update-navigation-bar-title-color) – timbre timbre Apr 17 '23 at 19:03

1 Answers1

0

Inside the initializer of the View, you can provide the color using UIKit commands.

Here's how it works:

struct MyView: View {

    init() {
        UINavigationBar.appearance().largeTitleTextAttributes = [.foregroundColor: UIColor(Color.blue)]   // Change blue with your desired color
        UINavigationBar.appearance().titleTextAttributes = [.foregroundColor: UIColor(Color.blue)]   // Change blue with your desired color
    }

    var body: some View {
        // Whatever
    }
}
HunterLion
  • 3,496
  • 1
  • 6
  • 18