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>- это визуальный компонент, отображающий текст, доступный только в режиме для чтения.

ВАЖНО: Этот <Label> не то же самое, что HTML <Label>.


<Label text="Label" />

Стилизация элемента label

Если вам необходимо применить стили, то вы можете использовать комбинацию элементов FormattedString и 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>

Свойства

ИмяТипОписание
textStringЗадает или получает текст для отображения.
textWrapBooleanЗадает или получает значение, оборачивет текст элемент label.
Значение по умолчанию: false.

Нативный компонент

AndroidiOS
android.widget.TextViewUILabel
Contributors