TextAlign

Class

Common
value class TextAlign internal constructor(internal val value: Int)

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

Companion Object

Properties

Common
val Left = TextAlign(1)

Align the text on the left edge of the container.

Common
val Right = TextAlign(2)

Align the text on the right edge of the container.

Common
val Center = TextAlign(3)

Align the text in the center of the container.

Common
val Justify = TextAlign(4)

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.

Common
val Start = TextAlign(5)

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.

Common
val End = TextAlign(6)

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.

Common
val Unspecified = TextAlign(Int.MIN_VALUE)

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

Methods

Common
fun values(): List<TextAlign>

Return a list containing all possible values of TextAlign.