flutter - 被键盘隐藏的TextFormField - Flutter

标签 flutter dart flutter-layout

当焦点在 TextFormField 上时,键盘会隐藏在 TextFormField 上。我将 SingleScrollview 与 Column 小部件一起使用。下面我附上了带有编码的屏幕截图。请指导我解决此问题。

Scaffold(
  resizeToAvoidBottomInset: false,
  resizeToAvoidBottomPadding: false,
  key: _scaffoldKey,
  body: SingleChildScrollView(
  child: Padding(
    padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
    child: new Column(
      children: <Widget>[
        _tabText(),
        isSignin ? _loginContainer() : _signUpContainer(),
      ],
    ),),),);

enter image description here enter image description here

最佳答案

//将“resizeToAvoidBottomInset: true”这行添加到您的脚手架中,并将您的主 ScrollView 中的容器。

    @override
    Widget build(BuildContext context) {
   return Scaffold(
   resizeToAvoidBottomInset: true,
   key: _scaffoldKey,
   backgroundColor: Colors.white,
   body: SingleChildScrollView(    
      child: Container()
    ),
   );
  }

关于flutter - 被键盘隐藏的TextFormField - Flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59694058/

相关文章:

android - Flutter Form:方法 'validate'在null上调用。 [所有配置均已配置]

flutter - 编译时间错误 : Type arguments in partial instantiations must be instantiated and are therefore not allowed to depend on type parameters

flutter - 将容器缩小到较小的 child 而不是扩大到填充 parent

Dart json.encode 返回带有不带引号的键值的 json 字符串

Flutter 如何制作可选择/可聚焦的小部件

dart - 如何在 Flutter 中创建基工厂并在子类上覆盖它

flutter - 发布请求后如何处理响应httpClient

json - Flutter POST json 请求正文在服务器端为空/null

flutter - 使用热重载时简单字符串标题不会更新

flutter - 当有最终完成者时,如何使我注入(inject)的 javascript 代码出现?