Textfield在iOS Simulator上不显示键盘 [英] Textfield does not show Keyboard on iOS Simulator
问题描述
我正在尝试使用基本的Textfields在此处构建一个简单的登录屏幕,但是我无法使键盘出现在模拟器中。
通过物理键盘输入可以正常工作,但是在iOS模拟器没有可见的键盘。我需要显式打开它还是其他?
I'm trying to build a simple login screen here using basic Textfields, but I can't get a keyboard to appear in the Simulator.
Input via the physical keyboard works just fine, but in the iOS Simulator there is no keyboard visible. Do I have to explicitly open it or something?
感觉好像我在这里丢失了一些非常基本的东西。
Feels like I'm missing something really basic here.
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 切换软件键盘的连接。
Solution Turns out if the hardware keyboard is connected, it will suppress the software keyboard. cmd + shift + k disconnects the hardware keyboard or cmd + k toggles the software keyboard.
推荐答案
- 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.
这篇关于Textfield在iOS Simulator上不显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!