{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

TextAlign.Companion

public static class TextAlign.Companion


Summary

Public methods

static final @NonNull TextAlign

Align the text in the center of the container.

static final @NonNull TextAlign

Align the text on the trailing edge of the container.

static final @NonNull TextAlign

Stretch lines of text that end with a soft line break to fill the width of the container.

static final @NonNull TextAlign

Align the text on the left edge of the container.

static final @NonNull TextAlign

Align the text on the right edge of the container.

static final @NonNull TextAlign

Align the text on the leading edge of the container.

static final @NonNull List<@NonNull TextAlign>

Return a list containing all possible values of TextAlign.

Public methods

getCenter

public static final @NonNull TextAlign getCenter()

Align the text in the center of the container.

getEnd

public static final @NonNull TextAlign getEnd()

Align the text on the trailing edge of the container.

For Left to Right text (ResolvedTextDirection.Ltr), this is the right edge.

For Right to Left text (ResolvedTextDirection.Rtl), like Arabic, this is the left edge.

getJustify

public static final @NonNull TextAlign getJustify()

Stretch lines of text that end with a soft line break to fill the width of the container.

Lines that end with hard line breaks are aligned towards the Start edge.

getLeft

public static final @NonNull TextAlign getLeft()

Align the text on the left edge of the container.

getRight

public static final @NonNull TextAlign getRight()

Align the text on the right edge of the container.

getStart

public static final @NonNull TextAlign getStart()

Align the text on the leading edge of the container.

For Left to Right text (ResolvedTextDirection.Ltr), this is the left edge.

For Right to Left text (ResolvedTextDirection.Rtl), like Arabic, this is the right edge.

values

public static final @NonNull List<@NonNull TextAlignvalues()

Return a list containing all possible values of TextAlign.