Text Tightening
Sets whether text in this view can compress the space between characters when necessary to fit text in a line.
Platform Compatibility
Tags
SwiftUI Code
VStack {
Text("FooBar FooBar")
.lineLimit(1)
.allowsTightening(true)
.frame(width: width, alignment: .leading)
.background(.red)
Text("FooBar FooBar")
.lineLimit(1)
.allowsTightening(false)
.frame(width: width, alignment: .leading)
.background(.red)
}