TextAlign
-
Cmn
value class TextAlign
Defines how to align text horizontally. TextAlign controls how text aligns in the space it appears.
Summary
Public companion functions |
||
|---|---|---|
TextAlign |
Creates a TextAlign from the given integer value. |
Cmn
|
List<TextAlign> |
values()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
|
Extension functions |
||
|---|---|---|
inline TextAlign |
TextAlign.takeOrElse(block: () -> TextAlign)If |
Cmn
|
Extension properties |
||
|---|---|---|
Boolean |
Returns |
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.
This function throws an IllegalArgumentException if the given value is not recognized by the preset TextAlign values.
| Parameters | |
|---|---|
value: Int |
The integer representation of the TextAlign. |
| See also | |
|---|---|
value |
Public companion properties
End
val End: TextAlign
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 Justify: TextAlign
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.
Start
val Start: TextAlign
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 Unspecified: TextAlign
This represents an unset value, a usual replacement for "null" when a primitive value is desired.
Extension functions
takeOrElse
inline fun TextAlign.takeOrElse(block: () -> TextAlign): TextAlign
If isSpecified is true then this is returned, otherwise block is executed and its result is returned.
Extension properties
isSpecified
val TextAlign.isSpecified: Boolean
Returns true if this TextAlign is not TextAlign.Unspecified.
| See also | |
|---|---|
Unspecified |