MobileUI LogoMobileUI
/

TextView


The TextView (sometimes called a Label) displays text.

TextView on iOS
TextView on Android
iOSAndroid

Usage

Text via attribute
<TextView text="Hello World!"/>
Text via text child
<TextView fontFamily="monospace" fontWeight="bold" fontSize="12">
    <text>But wait, there is one more thing!</text>
</TextView>

Children

An optional text element as replacement for the text attribute.

Attributes

NameTypeDefaultBindingDescription

Inherits all attributes from View and adds the following:

text

string

output

The text to display.

textColor

colorType

black

output

Sets the (default) color of the text.

fontSize

float

platform-default

output

Sets the size of the text in dp.

fontWeight

enum

regular

output

Sets the weight of the text to either bold or regular

fontStyle

enum

regular

output

Sets the style of the text. Allowed values are italic, oblique and regular.

fontFamily

string

platform-default

output

Sets the font family of the text. Examples are serif, sans-serif and sans-serif-medium.

fontVariant

enum

platform-default

output

Sets the font variant of the text. Allowed values are small-caps and regular.

hint

string

output

Hint text to display when the text is empty.

textHorizontalAlign

enum

platform-default

output

Horizontal alignment of the text within the TextView. Allowed values: left, center and right.

textVerticalAlign

enum

platform-default

output

Vertical alignment of the text within the TextView. Allowed values: top, center and bottom.

lines

unsigned int

1

output

Makes the TextView be exactly this many lines tall.

minLines

unsigned int

output

Makes the TextView be at least this many lines tall.

maxLines

unsigned int

output

Makes the TextView be at most this many lines tall.

maxWidth

sizeType

output

Makes the TextView be at most this wide.

maxHeight

sizeType

output

Makes the TextView be at most this tall.

ellipsize

enum

none

output

If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. Must be one of the following constant values: none, start, middle, end and marquee


Parts of this documentation are a derivate of the Android Developer Documentation by Google used under CC-BY-2.5.