Skip to content

KeyboardType 继承自: Enum

文本输入控件所针对优化的信息类型。

在 Android 上,具体行为可能因设备和输入法提供商而异。

枚举值 ​

名称类型默认值说明
NONE—'none'Prevents the OS from showing the on-screen virtual keyboard.
TEXT—'text'Optimized for textual information. Requests the default platform keyboard.
MULTILINE—'multiline'Optimized for multiline textual information. Requests the default platform keyboard, but accepts newlines when the enter key is pressed. This is the input type used for all multiline text fields.
NUMBER—'number'Optimized for unsigned numerical information without a decimal point. Requests a default keyboard with ready access to the number keys.
PHONE—'phone'Optimized for telephone numbers. Requests a keyboard with ready access to the number keys, "*", and "#".
DATETIME—'datetime'Optimized for date and time information. - On iOS, requests the default keyboard. - On Android, requests a keyboard with ready access to the number keys, ":", and "-".
EMAIL—'email'Optimized for email addresses. Requests a keyboard with ready access to the "@" and "." keys.
URL—'url'Optimized for URLs. Requests a keyboard with ready access to the "/" and "." keys.
VISIBLE_PASSWORD—'visiblePassword'Optimized for passwords that are visible to the user. Requests a keyboard with ready access to both letters and numbers.
NAME—'name'Optimized for a person's name. - On iOS, requests the UIKeyboardType.namePhonePad keyboard, a keyboard optimized for entering a person’s name or phone number. Does not support auto-capitalization. - On Android, requests a keyboard optimized for TYPE_TEXT_VARIATION_PERSON_NAME.
STREET_ADDRESS—'streetAddress'Optimized for postal mailing addresses. - On iOS, requests the default keyboard. - On Android, requests a keyboard optimized for TYPE_TEXT_VARIATION_POSTAL_ADDRESS.
WEB_SEARCH—'webSearch'Optimized for web searches. Requests a keyboard that includes keys useful for web searches as well as URLs. - On iOS, requests a default keyboard with ready access to the "." key. In contrast to URL, a space bar is available. - On Android this is remapped to the URL keyboard type as it always shows a space bar.
TWITTER—'twitter'Optimized for social media. Requests a keyboard that includes keys useful for handles and tags. - On iOS, requests a default keyboard with ready access to the "@" and "#" keys. - On Android this is remapped to the EMAIL keyboard type as it always shows the "@" key.

关注我,学习大模型、大数据、Python等热门技术。