Skip to content

TextField

Text field in an alert.

Use the text field to customize the appearance of the text entered into it.

You do not create create instances of this. Instead you should add a text field to an Alert using the addTextField() and addSecureTextField() on the alert.

Font of the text.

font: Font

Hides the text that is entered when set to true.

isSecure: bool

The default value is false.

Placeholder shown in the text field while it is empty.

placeholder: string

Text in the text field.

text: string

Color of the text.

textColor: Color

Center aligns the text.

centerAlignText()

Left aligns the text.

leftAlignText()

This is the default text alignment.

Right aligns the text.

rightAlignText()

Use a numeric keyboard with a decimal point for entering text.

setDecimalPadKeyboard()

Use the default keyboard for entering text.

setDefaultKeyboard()

Use a keyboard that prominently features the @, period and space characters.

setEmailAddressKeyboard()

Use a keyboard that prominently features the numbers 0 through 9.

setNumberPadKeyboard()

Use a numeric keyboard with punctuation for entering text.

setNumbersAndPunctuationKeyboard()

Use a keyboard that prominently feaetures the numbers 0 through 9 and the * and # characters.

setPhonePadKeyboard()

Use a keyboard that prominently features the @ and # characters.

setTwitterKeyboard()

Use a keyboard that prominently faetures the period and slash characters and the “.com” string.

setURLKeyboard()

Use a keyboard that prominently features the space and period characters.

setWebSearchKeyboard()