object.inputType

类型 字符串
对象 TextField
native.*
修订 版本 2024.3703
关键词 键盘, 键盘类型, 文本输入, 文本框, 原生文本

概述

设置原生文本输入框的键盘类型。

键盘类型

可能的字符串值有

iOS 扩展

以下值是 iOS 特定的,对应于 iOS API 中实际常量的名称

  • "UIKeyboardTypeASCIICapable"
  • "UIKeyboardTypeNumbersAndPunctuation"
  • "UIKeyboardTypeNamePhonePad"
  • "UIKeyboardTypeTwitter"
  • "UIKeyboardTypeWebSearch"

请查阅 iOS 关于 UIKeyboardType 的文档,了解每种键盘类型的说明。

陷阱

示例

local numericField = native.newTextField( 50, 150, 220, 36 )
numericField.inputType = "number"