Label
Definition
Labels are components used to show text.
A label displays text which is specified by the Text
property. Other properties, all of which can be set in the Designer or Blocks Editor, control the appearance and placement of the text.
Properties
- BackgroundColor
- Specifies the label’s background color as an alpha-red-green-blue integer.
- FontBold
- Specifies whether the label’s text should be bold. Some fonts do not support bold.
- FontItalic
- Specifies whether the label’s text should be italic. Some fonts do not support italic.
- FontSize
- Specifies the label’s text’s font size, measured in sp(scale-independent pixels).
- FontTypeface
- Specifies the label’s text’s font face as default, serif, sans serif, or monospace.
- HTMLContent
- Returns the content of the Label as HTML. This is only useful if the HTMLFormat property is true.
- HTMLFormat
- Specifies the label’s text’s format
- HasMargins
- Specifies whether the label should have margins. This margin value is not well coordinated with the designer, where the margins are defined for the arrangement, not just for individual labels.
- Height
- Specifies the
Label
’s vertical height, measured in pixels. - HeightPercent
- Specifies the
Label
’s vertical height as a percentage of theScreen
’sHeight
. - Text
- Specifies the text displayed by the label.
- TextAlignment
- Specifies the alignment of the label’s text: center, normal (e.g., left-justified if text is written left to right), or opposite (e.g., right-justified if text is written left to right).
- TextColor
- Specifies the label’s text color as an alpha-red-green-blue integer.
- Visible
- Specifies whether the
Label
should be visible on the screen. Value istrue
if theLabel
is showing andfalse
if hidden. - Width
- Specifies the horizontal width of the
Label
, measured in pixels. - WidthPercent
- Specifies the horizontal width of the
Label
as a percentage of theScreen
’sWidth
.