1

I am trying to align left text in Text component in Swift UI.

aling text

As you can see on above image I applied with below code but does not work. Anything missing?

Text(titleSring).frame(alignment: .trailing).background(Color.red)
Manish
  • 608
  • 1
  • 11
  • 23

1 Answers1

5

A frame alignment is for entire view (which is square), you need multi-line text alignment, like

Text(titleSring)
    .multilineTextAlignment(.leading)
Asperi
  • 228,894
  • 20
  • 464
  • 690