This is a SwiftUI question, not UIKit
I'm trying to set a different font for the navigation bar title using SwiftUI. My suspicion is that this isn't supported yet. Here's what I've tried:
var body: some View {
NavigationView {
.navigationBarTitle(Text("Dashboard").font(.subheadline), displayMode: .large)
}
}
No matter what I do with the .font
settings, it doesn't change the text. I've also tried setting a custom font and removing the displayMode
property.
Has anyone been able to get this to work?
Text("...")
with font modifying asnavigationBatTitle
parameter, furthermore Xcode says in runtime it's not acceptable to apply any kind of modifications to the nav bar title itself. So you can type.navigationBarTitle("Dashboard")
and that would be enough. – Ban