Textfield在iOS Simulator上不显示键盘
问题内容:
我正在尝试使用基本的文本字段在此处构建一个简单的登录屏幕,但无法在模拟器中显示键盘。
通过物理键盘输入可以正常工作,但是在iOS Simulator中没有可见的键盘。我是否必须显式打开它?
感觉就像我在这里错过了一些非常基本的东西。
buildLoginScreen() {
return new Container(
padding: EdgeInsets.only(left: 50.0, right: 50.0),
child: new Column(
children: <Widget>[
new TextField(
style: new TextStyle(color: Colors.white),
autofocus: true,
autocorrect: false,
decoration: new InputDecoration(
labelText: 'Login',
),
onChanged: (text) { _userLoginEmail = text; },
),
new TextField(
autofocus: false,
autocorrect: false,
obscureText: true,
decoration: new InputDecoration(
labelText: 'Password'
),
onChanged: (text) { _userLoginPassword = text; },
)
],
),
);
}
解决方案 事实证明,如果连接了硬件键盘,它将抑制软件键盘。 cmd + shift + k 断开硬件键盘的连接,或 cmd + k
切换软件键盘的连接。
问题答案:
CMD
+Shift
+K
切换 硬件键盘的 连接性,如果另一个 断开连接 ,则默认情况下将打开 软件键盘 。 __CMD
+K
切换 软件键盘 的可见性。