flutter 软键盘挤压页面导致变形溢出

2020-01-16  本文已影响0人  天渺工作室

flutter 解决这种有两种办法 一种就是传统的嵌套 SingleChildScrollView 让页面可以上下滑动 如果不想改变页面结构

flutter 类入口的 Scaffold 的resizeToAvoidBottomInset: false 就可以

注意: 一个页面不管嵌套了多少类 只要用了Scaffold 都需要设置 resizeToAvoidBottomInset: false

image.png
 @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset:false,
      appBar: CenterTitleAppBar(
        title: '会员',
        actions: <Widget>[
 
        ],
      ),
      body:MemberIndex(),
    );
  }
}

这样软键盘就不会挤压页面了

上一篇 下一篇

猜你喜欢

热点阅读