TextAlign


Defines how to align text horizontally. TextAlign controls how text aligns in the space it appears.

Summary

Public companion functions

TextAlign
valueOf(value: Int)

Creates a TextAlign from the given integer value.

Cmn
List<TextAlign>

Return a list containing all possible values of TextAlign.

Cmn

Public companion properties

TextAlign

Align the text in the center of the container.

Cmn
TextAlign

Align the text on the trailing edge of the container.

Cmn
TextAlign

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

Cmn
TextAlign

Align the text on the left edge of the container.

Cmn
TextAlign

Align the text on the right edge of the container.

Cmn
TextAlign

Align the text on the leading edge of the container.

Cmn
TextAlign

This represents an unset value, a usual replacement for "null" when a primitive value is desired.

Cmn

Public functions

open String
Cmn

Public properties

Boolean

Returns true if this baseline shift is not TextAlign.Unspecified.

Cmn
Int
Cmn

Public companion functions

valueOf

fun valueOf(value: Int): TextAlign

Creates a TextAlign from the given integer value. This can be useful if you need to serialize/deserialize TextAlign values.

Parameters
value: Int

The integer representation of the TextAlign.

See also
value

values

fun values(): List<TextAlign>

Return a list containing all possible values of TextAlign.

Public companion properties

Center

val CenterTextAlign

Align the text in the center of the container.

End

val EndTextAlign

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.

Justify

val JustifyTextAlign

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.

Left

val LeftTextAlign

Align the text on the left edge of the container.

Right

val RightTextAlign

Align the text on the right edge of the container.

Start

val StartTextAlign

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.

Unspecified

val UnspecifiedTextAlign

This represents an unset value, a usual replacement for "null" when a primitive value is desired.

Public functions

toString

open fun toString(): String

Public properties

isSpecified

val isSpecifiedBoolean

Returns true if this baseline shift is not TextAlign.Unspecified.

See also
Unspecified

value

val valueInt