I'm building a widget for iOS 14 and would like some of the content to align to the left, with some of the other content on the right. How would I do this?
Here's my code now:
ZStack {
HStack(alignment: .center, spacing: nil, content: {
VStack(alignment: .leading, spacing: nil, content: {
Text("Heading")
.zIndex(2)
.shadow(radius: 5)
Text("Subtitle")
.zIndex(1)
.shadow(radius: 2.5)
})
})
Image("Image")
.zIndex(-1)
}
I would like the Heading and Subtitle text aligned to the very left of the widget, so I can add more information on the center / right side.
Thanks in advance! I'm fairly new to SwiftUI, so it's all a bit of learning.
Add spacer in HStack