Label

Inheritance: Element -> NavigableElement -> VisualElement -> View Xamarin.Forms documentation: Label API / Guide

For details on how the control actually works, please refer to the Xamarin.Forms documentation.

Constructors

Properties

Shorthand properties

Events

None

Usages

Label("Hello World")
    .characterSpacing(1.)
    .font(namedSize = NamedSize.Large, fontFamily = "Arial", attributes = FontAttributes.Bold)
    .horizontalTextAlignment(TextAlignment.Center)
    .lineBreakMode(LineBreakMode.WordWrap)
    .lineHeight(1.5)
    .maxLines(1)
    .padding(10.)
    .textColor(light = Color.Red.ToFabColor(), dark = Color.Blue.ToFabColor())
    .textDecoration(TextDecorations.Underline)
    .textTransform(TextTransform.Lowercase)
    .textType(TextType.Text)
    .verticalTextAlignment(TextAlignment.Center)

Use shorthand properties

Label("Hello World")
    .size(500., 500.)
    .centerTextHorizontal()
    .centerTextVertical()

Get access to the underlying Xamarin.Forms.Label

let labelRef = ViewRef<Label>()

Label("Hello World")
    .reference(labelRef)

Last updated