颤振-底部溢出119个像素 [英] Flutter - Bottom Overflowed By 119 Pixels
本文介绍了颤振-底部溢出119个像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在ListView内创建图像时出现错误"底部溢出199像素",并且在我用google搜索后,所有这些都建议我添加:
I had an error "Bottom Overflowed by 199 pixel" when creating an Image inside the ListView, and after i google it, all of them suggest me to add:
resizeToAvoidBottomPadding: false
但是,它不起作用!该错误仍然存在.
But, it doesnt work! The error is still there.
SafeArea小部件也无法解决问题.这是我的布局的简短代码版本:
SafeArea widget is also doesnt solve the problem. Here is the short code version of my layout:
body: ListView(
children:<Widget> [
new Container(
child: new Stack(
children:<Widget> [
//THE WIDGET
new Container(), //THE BACKGROND IMAGE
new Positioned(
child: Column(
children:<Widget>[
new Transform(),
new FadeTransition(),
new FadeTransition(),
Divider(),
new Row(),
//THE IMAGE THAT I WANT TO ADD
new Container(
height: 360.0
decoration: BoxDecoration(
image: DecorationImage(
image: Assetimage('lake.jpg)
推荐答案
将您的内容放入 SingleChildScrollView
,然后添加 ConstrainedBox
像这样:
put your contents in a SingleChildScrollView
and add ConstrainedBox
like this:
body :SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(),
child: ListView(
children:<Widget> [
new Container(
child: new Stack(
children:<Widget> [
//THE WIDGET
new Container(), //THE BACKGROND IMAGE
new Positioned(
child: Column(
children:<Widget>[
new Transform(),
new FadeTransition(),
new FadeTransition(),
Divider(),
new Row(),
//THE IMAGE THAT I WANT TO ADD
new Container(
height: 360.0
decoration: BoxDecoration(
image: DecorationImage(
image: Assetimage('lake.jpg)
这可能会使您的屏幕可滚动,并且添加约束将使其变为有限滚动.
This is may make your screen scrollable and adding constraint will make it finite scroll.
这篇关于颤振-底部溢出119个像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文