Type String Object TextField Library native.* Revision Release 2022.3683 Keywords keyboard, keyboard type, text input, text field, native text
Sets the keyboard type for a native text input field.
Possible string values are:
"default"
— the default keyboard, supporting general text, numbers and punctuation."number"
— a numeric keypad."decimal"
— a keypad for entering decimal values."phone"
— a keypad for entering phone numbers."url"
— a keyboard for entering website URLs."email"
— a keyboard for entering email addresses."no-emoji"
— the default keyboard, supporting general text, numbers and punctuation but does not allow emoji to be typed.The following values are iOS-specific and correspond to the names of actual constants in the iOS API:
"UIKeyboardTypeASCIICapable"
"UIKeyboardTypeNumbersAndPunctuation"
"UIKeyboardTypeNamePhonePad"
"UIKeyboardTypeTwitter"
"UIKeyboardTypeWebSearch"
Please consult the iOS documentation on UIKeyboardType for an explanation of each keyboard type.
To create an obscured password entry field, set the object.isSecure boolean property to true
.
The Corona Simulator and desktop apps do not support the "phone"
, "url"
, or "email"
input types.
Some operating systems permit the user to paste text which includes emoji, even though they can't be typed.
Note that "emoji" is narrowly defined to be the
local numericField = native.newTextField( 50, 150, 220, 36 ) numericField.inputType = "number"