TextView

The TextView (sometimes called a Label) displays text with basic HTML features.

Examples

Hello World
<TextView text="Hello World!"/>
Using HTML for rich text
<TextView>
<text><![CDATA[
TextView with <tt>simple</tt>
<font color="red">HTML-formatting</font> for
<b>bold</b>,
<i>italic</i>,
<u>underlined</u> and more:
<h1>Heading1</h1>
<a href="http://www.remoteui.org">RemoteUI.org</a>
<h2>Heading2</h2>
]]></text></TextView>

Children

An optional text element as replacement for the text attribute.

Attributes

Name Type Default Binding Description

Inherits all attributes from View and adds the following:

text

string

output

The text to display. You can optionally use basic HTML tags to format this text, e.g. <b>, <i>, <font> as well as clickable links with <a> and more (For a full list of supported tags see the corresponding source code). To allow embedding these tags, you need to use the <text> child tag instead and embed a CDATA section as shown in the example above.

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

textShadow

shadowType

output

Defines an outer shadow for the text with <x-offset> <y-offset> <blur-radius> <color> E.g: 2dp 3dp 1dp #8000.

textInnerShadow

shadowType

output

Defines an inner shadow for the text with <x-offset> <y-offset> <blur-radius> <color> E.g: 2dp 3dp 1dp #8000.


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

results matching ""

    No results matching ""