我试图使内容Container
可滚动,并且我认为我可能滥用了SingleChildScrollView
小部件。
是否可以将其放入Container
(作为其子项)内部,因为我希望其内容可滚动?
谢谢。
Hero(
tag: this.widget.id,
child: Material(
type: MaterialType.transparency,
child: Center(
child: Container(
margin: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.25),
height: MediaQuery.of(context).size.height * 0.75,
width: MediaQuery.of(context).size.width * 0.95,
decoration: cardDecoration,
child: SingleChildScrollView(
child: ContentTripExtract(this.widget.i, false) // a column of texts and containers
),
),
),
),
),
您需要指定SingleChildScrollView只有一个孩子,如下所示:
child: SingleChildScrollView(
child: Container(
并且不要在子视图中使用flex。就您而言,我认为它有效
child: SingleChildScrollView(
child: Container(
child: ContentTripExtract(this.widget.i, false) // a column of texts and containers
),
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句