I don't know if this is a bug in the multilineTextAlignment
modifier or the playground preview.
Here is my code:
let twoLines = "Think\nDifferent"
let twoSentences = """
Think Different
Stay hungry and stay foolish
"""
Text(twoLines)
.frame(width: 200, height: 60)
.border(.red)
.multilineTextAlignment(.trailing)
Text(twoSentences)
.frame(width: 200, height: 100)
.border(.red)
.multilineTextAlignment(.trailing)
The output for the first Text
element looks like this:
The output for the second Text
element looks like this:
Shouldn't it be right justified the text and center within the Text
frame?
If I set the frame width to 300, it behaves as I expected
My XCode version is 14.2.