Contents

trailing

A guide that marks the trailing edge of the view.

Declaration

static let trailing: HorizontalAlignment

Discussion

Use this guide to align the trailing edges of views. For a device that uses a left-to-right language, the trailing edge is on the right:

[Image]

The following code generates the image above using a VStack:

struct HorizontalAlignmentTrailing: View {
    var body: some View {
        VStack(alignment: .trailing, spacing: 0) {
            Color.red.frame(width: 1)
            Text("Trailing").font(.title).border(.gray)
            Color.red.frame(width: 1)
        }
    }
}

See Also

Getting guides