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> es un componentede UI para mostrar un texto de solo lectura.

IMPORTANTE: Este <Label> NO es lo mismo que el <label> de HTML.


<Label text="Label" />

Agregando estilos a <Label>

Si necesitas agregar estilos a partes del texto, puedes usar una combinación de los elementos FormattedString y 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>

Propiedades

NombreTipoDescripción
textStringObtiene o establece el texto del elemento label.
textWrapBooleanObtiene o establece cuando el texto se ajusta o no al elemento que lo contiene.
Valor por defecto: false.

Componente nativo

AndroidiOS
android.widget.TextViewUILabel
Contributors