-1

Prompt, in SwiftUI when largeTitleDisplayMode is true, the distance between letters becomes too small than when title in navigation bar. Is it possible to turn off this compression of letters or increase the distance of letters when title is large. Unfortunately there is no way to change the font.

enter image description here

enter image description here

  • follow the https://stackoverflow.com/questions/14956561/how-to-resize-title-in-a-navigation-bar-dynamically. hope this work for you – Sumit_VE Oct 11 '21 at 10:26
  • This might be of some help: https://www.hackingwithswift.com/quick-start/swiftui/how-to-add-spacing-between-letters-in-text – tromgy Oct 11 '21 at 11:20

1 Answers1

2

you can add a label in your navigation bar with following formate hope this will helps you.

let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 40))
label.text = "your navigation bar title"
label.textColor = .black
label.font = UIFont.systemFont(ofSize: 30, weight: .bold)
label.adjustsFontSizeToFitWidth = true
label.textAlignment = .center
self.navigationItem.titleView = label
Muhammad Nawaz
  • 1,113
  • 6
  • 15