flutter 软键盘弹起导致定位底部按钮浮动在键盘上的问题


1、1.1.19版本一下的,可以设置resizeToAvoidBottomInset为false,键盘弹起不会resize。

Scaffold(
       appBar: AppBar(''),
       resizeToAvoidBottomPadding: false, //输入框抵住键盘
       body:,
)

2、固定页面的的高度,将高度写死。

body: SingleChildScrollView(
          child: MediaQuery.removePadding(
            context: context,
            removeTop: true,
            removeBottom: true,
            child: Container(
              height: MediaQuery.of(context).size.height - 56.0 - MediaQuery.of(context).padding.bottom - MediaQuery.of(context).padding.top,
              child: Container(),
          )
      ),

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM