I have the following SwiftUI Text view:
Text("Hello, world. foo bar foobar foo hello world")
.frame(maxWidth: .infinity, alignment: .leading)
.padding()
.background(Color.red)
which renders like this (screenshots from Xcode preview, iPhone 13 Pro):
Adding a single character to the string causes the view to render as follows:
There is clearly space for "hello" on the first line, but the layout engine breaks the lines presumably where it feels is best. Is there any way to control this, to get the text to flow as far as it can on each line, within the constraints of the view?


