[英]Textfield does not show Keyboard on 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切换软件键盘的连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.