UserGuide

iOS Text Area

From Xojo Documentation

A Text Area control provies a multi-line field for entering text. When the user taps in the field, the on-screen keyboard automatically appears. A text area does not have a border around it.

Below are commonly used events and properties. Refer to iOSTextArea in the Language Reference for the complete list.

Events

TextChange

Called each time the text changes. This means it may be called many times as the user is typing into the field.

Properties

Editable

A boolean that indicates if the user can edit the text in the text area. When false, the text cannot be modified, but the user can select and copy text it contains.

Text

The text contained in the text area. Set this property to populate the text area, or access it to get the text entered into the text area.

TextAlignment, TextColor, TextFont

These properties change the alignment, color and size of the text.

Usage

To populate the Text Area, set its Text property either using the Inspector or with code:

DescArea.Text = "This is some default text."

To get the text within the Text Area, you also use the Text property:

Var description As Text
description = DescArea.Text

Like with a TextField, the TextChange event is called as the text is changed by the user editing in the text area. You might use this event so save the text to a property for use elsewhere in your app:

Description = Me.Text // Description is a property of the view

See Also

iOSTextArea class; UserGuide:iOS Text Field, UserGuide:iOS UI topics