【发布时间】:2019-08-16 09:15:04
【问题描述】:
我不明白我在这里缺少什么。我将 TextInputType 设置为数字,仍然可以输入任何字母、特殊字符甚至表情符号。我还尝试让孩子成为 TextInputType.numberWithOptions() 小部件,它会打开同一个键盘。这只是我手机上的一个错误吗? P20 专业版
Row(
children: <Widget>[
Text('TextInputType.number:'),
Flexible(
child: TextField(
maxLength: 3,
keyboardType: TextInputType.number,
)),
],
)
【问题讨论】:
-
keyboardType: TextInputType.number正在为我显示数字键盘。尝试再次卸载并重新安装该应用程序。也尝试使用其他键盘,然后使用 SwiftKey。
标签: flutter