简体   繁体   English

一个 RenderFlex 溢出底部 flutter

[英]A RenderFlex overflowed bottom flutter

when I run the project it shows A RenderFlex overflowed on the bottom当我运行该项目时,它显示 A RenderFlex overflowed on the bottom 在此处输入图像描述 A RenderFlex overflowed by 6.7 pixels on the bottom.底部溢出 6.7 像素的 RenderFlex。

In your Scaffold, set resizeToAvoidBottomInset property to false.在您的脚手架中,将resizeToAvoidBottomInset属性设置为 false。

Try below code hope its helpful to you.试试下面的代码希望它对你有帮助。 add your Column inside SingleChildScrollViewSingleChildScrollView中添加您的Column

Refer my answer here also也在这里参考我的回答

SingleChildScrollView(
   child:Column(
     children:[
      //Declare Your Widgets Here
     ],
   ),
),

When the kayboard appears, it may hide something.当键盘出现时,它可能隐藏了一些东西。 To avoid this problem, you can wrap the entire screen widget in a SingleChildScrollView .为避免此问题,您可以将整个屏幕小部件包装在SingleChildScrollView中。 This will mate the screen scrollable.这将使屏幕可滚动。

A quick solution would be to block the widgets inside the Scaffold to resize themselves when the keyboard opens but this way,一个快速的解决方案是阻止脚手架内的小部件在键盘打开时调整自己的大小但是这样,

return Scaffold(
      appBar: AppBar(
        title: Text('Expenses Tracker'),
      ),
      body: SingleChildScrollView( // wrap with a scrollable widget
        child: Column(
          children: <Widget>[
            ...... // other widgets 
          ],
        ),
      ),
    );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM