我试图使用基本文本字段在这里构建一个简单的登录屏幕,但我无法让键盘出现在模拟器中。
通过物理键盘输入效果很好,但在 iOS 模拟器中没有可见的键盘。我必须明确打开它还是什么?
感觉我在这里错过了一些非常基本的东西。
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; },
)
],
),
);
}
Solution事实证明,如果连接了硬件键盘,它将抑制软件键盘。cmd + Shift + k断开硬件键盘或cmd + k切换软件键盘。
-
CMD +
Shift + K toggles connectivity of the hardware keyboard, which will open the software keyboard by default if the other one is disconnected.
-
CMD + K toggles the visibility of the software keybaord.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)