Search code examples
swiftuinavigationbarwatchos

How do I add color to navigationTitle in SwiftUI


.navigationTitle(Text("Hello").foregroundColor(.orange))
.navigationBarTitleDisplayMode(.inline)

How do I add a foreground color to a Navigation Bar Title in SwiftUI? This is a watchOS app and everything I tried doesn't work.


Solution

  • I found that this solution worked:

    .navigationTitle{
                Text("Hello")
                    .foregroundColor(.orange)
     }