leading
A guide that marks the leading edge of the view.
Declaration
static let leading: HorizontalAlignmentMentioned in
Discussion
Use this guide to align the leading edges of views. For a device that uses a left-to-right language, the leading edge is on the left:
[Image]
The following code generates the image above using a VStack:
struct HorizontalAlignmentLeading: View {
var body: some View {
VStack(alignment: .leading, spacing: 0) {
Color.red.frame(width: 1)
Text("Leading").font(.title).border(.gray)
Color.red.frame(width: 1)
}
}
}