简体   繁体   中英

Textfield does not show Keyboard on iOS Simulator

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; },
      )
    ],
  ),
);
}

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 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM