键盘在颤抖中的出现调整布局的大小

问题描述 投票:1回答:1

所以我在这里image 1构成了此布局页面,但是当我单击textfeild时,键盘出现并调整我的布局的大小,并出现错误,如您在此处看到的image 2这是我的代码

      body: Column(
          children: <Widget>[
              Expanded(
                child : Container(
                    padding:  EdgeInsets.only(top: 32,left: 31,right: 31),
                    color: hexToColor('#ffffff'),
                    height: MediaQuery.of(context).size.height,
                    child : Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[

                        Container(
                          padding:  EdgeInsets.only(top: 29),
                          child: Text("Your message",style: TextStyle(fontFamily: 'GilmerBold',color: hexToColor('#5c6277'),fontSize: 8),),
                        ),
                        Container(
                          padding:  EdgeInsets.only(top: 0,left: 10,right: 6),
                          decoration: BoxDecoration(
                            border: Border.all(color: hexToColor('#5c6277')),
                            borderRadius: BorderRadius.all(
                                Radius.circular(6.0) //                 <--- border radius here
                            ),
                          ),
                          height: 218,
                          margin:  EdgeInsets.only(top: 12),
                          child: TextField(
//                            keyboardType: TextInputType.multiline,
//                            maxLines: 10,
                            cursorColor: hexToColor('#f26937'),
                            decoration: new InputDecoration.collapsed(
//                                      border: new OutlineInputBorder(
//                                          borderSide: new BorderSide(color: hexToColor('#5c6277'),style: BorderStyle())
//                                      ),
                              hintText: "Write your message here…",hintStyle: TextStyle(fontFamily: 'GilmerRegular',color: hexToColor('#5c6277'),fontSize: 16),
                            ),
                          ),
                        ),
                        Spacer(),
                        //SizedBox(height: 32,),
                        ButtonTheme(
                            minWidth: 298.0,
                            height: 54.0,
                            child : RaisedButton(
                              onPressed: (){
                                //showAlertDialog(context);
                                //Navigator.push(context, MaterialPageRoute(builder: (context)=>aboutTheVehicule()),);
                              },
                              elevation: 0,
                              color : hexToColor('#e3e3e3'),
                              child: Text("Send message",
                                style: TextStyle( color : hexToColor('#5c6277'),fontFamily:'GilmerMedium'),),
                            )),
                        SizedBox(height: 32,),





                      ],
                    ),
                )
              )
          ]
      )

并且我搜索了goole,然后找到了要添加的解决方案resizeToAvoidBottomPadding:否,要么resizeToAvoidBottomInset:否,他们两个都不是我的解决方案

android ios flutter flutter-layout flutter-test
1个回答
0
投票
在您的脚手架的构造函数中,将

resizeToAvoidBottomInset设置为false。示例如下所示:

Scaffold( resizeToAvoidBottomInset: false );
Code Screenshot

Note

:不要使用resizeToAvoidBottomPadding,因为它已被弃用。
© www.soinside.com 2019 - 2024. All rights reserved.