Thanks to the above comment I experimented a bit more and I was able to fix it without using disabled button (as the button changes the opacity of the view when disabled)
The problem seems to be with the width calculation of the text - in my case specifying .frame(width: 200) on the Text in ToolbarItem renders the width properly:
NavigationView {
Text("Content")
.toolbar {
ToolbarItem(placement: .principal) {
Text("Title").frame(width: 200)
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: