Class

iOSLabel


Warning

This item was deprecated in version 2020r2. Please use MobileLabel as a replacement.

Description

This is the standard Label control for iOS.

Events

Name

Parameters

Returns

Close

Open

Property descriptions


iOSLabel.AccessibilityHint

AccessibilityHint As Text

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

Me.AccessibilityHint = "Click to calculate the value and display the next view."

iOSLabel.AccessibilityLabel

AccessibilityLabel As Text

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

Me.AccessibilityLabel = "Calculate the value."

iOSLabel.Enabled

Enabled As Boolean

Indicates if the label is enabled or disabled.

Disable a label:

Label1.Enabled = False

iOSLabel.Height

Height As Double

The height of the control.

This property is read-only.


iOSLabel.Left

Left As Double

The left position of the control.

This property is read-only.


iOSLabel.LineBreakMode

LineBreakMode As iOSLineBreakMode

Specifies how text contents break or wrap when the text is too long to fit. The default is iOSLineBreakMode.BreakByWordWrapping.

Break long text by truncating it in the middle:

Label1.LineBreakMode = Xojo.iOSLineBreakMode.BreakByTruncatingMiddle

iOSLabel.Name

Name As Text

The name of the control. This can only be set in the Inspector. Use the name to refer to the control.

This property is read-only.


iOSLabel.Parent

Parent As iOSControl

Indicates the control's parent object, if it has one. If there is no parent, this is Nil.

This property is read-only.


iOSLabel.Text

Text As Text

The text to display in the Label.

Set the label text:

Label1.Text = "Hello, World!"

iOSLabel.TextAlignment

TextAlignment As iOSTextAlignment

Specifies the alignment for the text. The default value is iOSTextAlignment.Left.

Center the text:

Label1.TextAlignment = Xojo.iOSTextAlignment.Center

iOSLabel.TextColor

TextColor As Color

The color of the text.

Set the text color to blue:

Label1.TextColor = Color.Blue

iOSLabel.TextFont

TextFont As iOSFont

The font used to display the text.

Use a larger font:

Label1.TextFont = iOSFont.BoldSystemFont(40)

iOSLabel.Top

Top As Double

The top position of the control.

This property is read-only.


iOSLabel.Visible

Visible As Boolean

Indicates whether the control is visible.

Make a button invisible:

Button1.Visible = False

iOSLabel.Width

Width As Double

The width of the control.

This property is read-only.

Method descriptions


iOSLabel.AddConstraint

AddConstraint(constraint As iOSLayoutConstraint)

Adds a constraint to the control. This constraint is used by child controls that have been added to this control.


iOSLabel.AddControl

AddControl(child As MobileControl)

Adds a child control to the control.


iOSLabel.Control

Control(index As Integer) As MobileControl

Gets the child control at the specified index.


iOSLabel.ControlCount

ControlCount As Integer

The number of child controls in the control.


iOSLabel.Handle

Handle As Ptr

The handle is used to get a reference to the control for interfacing directly with the iOS API.


iOSLabel.Invalidate

Invalidate

Marks the control so that it will be redrawn during the next event loop.

Call Invalidate to force a Canvas to redraw itself:

Canvas1.Invalidate

iOSLabel.RemoveConstraint

RemoveConstraint(constraint As iOSLayoutConstraint)

Removes a constraint from the control.


iOSLabel.RemoveControl

RemoveControl(child As MobileControl)

Removes the control from the control.


iOSLabel.SetTintColor

SetTintColor(value As Color)

Changes a control's tint color. This varies by control and for some controls may not do anything. For example, with an MobileTextField this changes the cursor color.

Event descriptions


iOSLabel.Close

Close

Called when the control is removed from its container, such as a view.


iOSLabel.Open

Open

Called after the control is created. This is where you typically put initialization code.

Set label text in Open event:

Me.Text = "Hello"

Compatibility

iOS projects on the iOS operating system.

See also

MobileControl parent class; Font