Type String Object TextField Library native.* Revision 2017.3060 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; not supported on Android."phone"
— a keypad for entering phone numbers."url"
— a keyboard for entering website URLs."email"
— a keyboard for entering email addresses.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 for Windows and Win32 desktop apps only support "default"
or "number"
input types.
The Corona Simulator for macOS and macOS desktop apps only support the "default"
input type.
local numericField = native.newTextField( 50, 150, 220, 36 ) numericField.inputType = "number"