I'm trying this:
import SwiftUI
struct LeftToRight: View {
var body: some View {
ZStack(alignment: .leading) {
Color.black
Text("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
.font(.system(size: 450))
.fixedSize(horizontal: true, vertical: false)
.foregroundColor(Color.pink)
}
.edgesIgnoringSafeArea(.all)
}
}
struct LeftToRight_Previews: PreviewProvider {
static var previews: some View {
LeftToRight()
}
}
But the ZStack alignment is having no effect - the Text
view center aligns (see screenshot).
I tried .leading
alignment guides on the Text view itself, also to no effect.
So how can I align this Text view so that no matter how big it gets, it starts at the left edge and grows out past the right edge?