Contents

lastTextBaseline

A guide that marks the bottom-most text baseline in a view.

Declaration

static let lastTextBaseline: VerticalAlignment

Discussion

Use this guide to align with the baseline of the bottom-most text in a view. The guide aligns with the bottom of a view that contains no text.

[Image]

The following code generates the image above using an HStack:

struct VerticalAlignmentLastTextBaseline: View {
    var body: some View {
        HStack(alignment: .lastTextBaseline, spacing: 0) {
            Color.red.frame(height: 1)
            Text("Last Text Baseline").font(.title).border(.gray)
            Color.red.frame(height: 1)
        }
    }
}

See Also

Getting guides