TextAlign
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
val Left = TextAlign(1)
Align the text on the left edge of the container.
val Right = TextAlign(2)
Align the text on the right edge of the container.
val Center = TextAlign(3)
Align the text in the center of the container.
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.
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.
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.
val Unspecified = TextAlign(Int.MIN_VALUE)
This represents an unset value, a usual replacement for "null" when a primitive value is desired.
Methods
fun values(): List<TextAlign>
Return a list containing all possible values of TextAlign.