I would like to left-align the content of a VStack
instead of centering it, but I don't know how to do it. Here is my code:
struct SortRow: View {
var sortType: SortType
@AppStorage(sortKey) var currentSorting: SortType = .winOrLoss
var body: some View {
VStack(alignment: .leading, spacing: 12) {
Text(sortType.name)
.multilineTextAlignment(.leading)
.font(.system(size: 15.0))
.foregroundColor(Color(sortType == currentSorting ? UIColor.white : UIColor.systemGray2))
Text(sortType.detail)
.multilineTextAlignment(.leading)
.font(.system(size: 13.0))
.foregroundColor(Color(sortType == currentSorting ? UIColor.white : UIColor.systemGray))
}
.frame(maxWidth: .infinity)
.padding(12)
.background(Color(sortType == currentSorting ? UIColor.systemGreen : UIColor.systemBackground))
}
}
What I get:
Why is there this left and right padding that centers the text content?
Thank you for your help