键盘出现时背景图片会挤压。
Scaffold(
body: Stack(
children: <Widget>[
Container(
width:double.infinity ,
height: double.infinity ,
child: Image.asset('assets/images/bg.png')),
Container(
child: SingleChildScrollView(
padding: EdgeInsets.all(width*0.10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(height: height*0.10,),
Container(decoration: BoxDecoration(color:Colors.transparent),child: Container(margin: EdgeInsets.only(bottom: height*0.02,left: 20.0,right: 20.0),child: Image.asset('assets/images/logo.png'),),),
SizedBox(height: height*0.05,),
Container(
decoration: BoxDecoration(color: Colors.transparent),
child: new Form(
key: _formKey,
autovalidate: _autoValidate,
child: LoginFrom(width,height))),
],
),
),
),
],
)
)
最佳答案
或者你应该使用脚手架参数
resizeToAvoidBottomInset: false
Scaffold(
resizeToAvoidBottomInset: false,
body: (your_code)
)
关于android - Flutter:键盘出现时背景图像被挤压,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54629235/