【发布时间】:2021-05-05 01:01:19
【问题描述】:
SingleChildScrollView(
child: Column(
children: [
Container(
height: 200.0,
width: double.infinity,
color: myBlue.withOpacity(.6),
child: TopCarouselSlider(bgColor: null),
),
//
Container(
height: MediaQuery.of(context).size.width * 1,
width: MediaQuery.of(context).size.width * 0.90,
color: myBlue.withOpacity(.5),
//
child: GridView.count(
mainAxisSpacing: 8,
crossAxisSpacing: 8,
crossAxisCount: 2,
children: [
Container(
height: 200.0,
width: 150.0,
color: myAccent,
),
Container(
height: 150.0,
width: 150.0,
color: myAccent,
),
Container(
height: 150.0,
width: 150.0,
color: myAccent,
),
Container(
height: 150.0,
width: 150.0,
color: myAccent,
)
],
),
),
],
),
),
问题:如果我尝试在 GridView 区域内使用滑动手势滚动页面,我不会获得滚动效果。这是否意味着在 SingleChildScrollView 中,Grid 或 List 的通常效果滚动不起作用? 请注意,我也尝试使用 GridView.Builder,但结果相同。想不出解决办法!
提前感谢您的帮助
【问题讨论】:
-
我试试你的代码,它工作。您会尝试在 GridView 中添加更多子项进行测试吗?