Label

This is an overview of the most common usage of Label. For more information about the available properties, methods, or events, head over to the complete API documentation for Label.

<Label> é um componente de UI que exibe um texto somente leitura.

IMPORTANTE: O <Label> não é o mesmo que o <Label> do HTML.


<Label text="Label" />

Estilizando o label

Se você precisa estilizar partes do texto, use a combinação de elementos FormattedString e Span.

<Label textWrap="true">
  <FormattedString>
    <Span text="This text has a " />
    <Span text="red " style="color: red" />
    <Span text="piece of text. " />
    <Span text="Also, this bit is italic, " fontStyle="italic" />
    <Span text="and this bit is bold." fontWeight="bold" />
  </FormattedString>
</Label>

Propriedades

nometipodescrição
textStringObtém ou define o texto do label.
textWrapBooleanObtém ou define se o texto do label quebra.
Valor padrão: false.

Componente Nativo

AndroidiOS
android.widget.TextViewUILabel
Contributors