2

Is there any way to make the navigationTitle at the top to be a multiline one, or shrink when that is too long? Now, in my case, it shows "..." at the end because of not enough spaces to display. i have checked all other posts and none of the results are related to swiftui solution.

user6539552
  • 1,331
  • 2
  • 19
  • 39

1 Answers1

2
init() {
    UILabel.appearance(whenContainedInInstancesOf: [UINavigationBar.self]).adjustsFontSizeToFitWidth = true
}

you can add this into your view struct

Reference to this SwiftUI Size to fit or word-wrap navigation title