【发布时间】:2020-08-22 09:45:06
【问题描述】:
当键盘出现时,Flutter 小部件会调整大小。如何在不使用
的情况下防止这种情况发生resizeToAvoidBottomInset : false,
如果我把它设为假,那么我看不到 TextFormField,因为键盘在它上面 那怎么办? 这是我的代码
return Scaffold(
// resizeToAvoidBottomInset : false,
body: Center(
child: Stack(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Image.asset('images/back_ui4.png',fit: BoxFit.fill,),
),
SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 0.7*MediaQuery.of(context).size.height,),
TextFormField()
],
),
),
],
),
),
);
【问题讨论】:
标签: flutter keyboard scrollview textfield scaffold