【发布时间】:2021-09-02 05:27:20
【问题描述】:
我在 Column -> Container 下有一个子 Axis.horizontal ListView.builder。我想要容器中的自动高度
Column(
children: [
Padding(...),
Container(
height: 200,
child: ListView.builder(
shrinkWrap: true,
itemCount: 6,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return brandListLayout('brandList![index]');
},
),
),
],
),
【问题讨论】:
-
将您的容器包装在展开的小部件中
-
@Brightcode 是水平的 ListView,所以我不想让我的 listview 包裹我的整个屏幕
-
您可能必须在容器中使用约束框,并为容器设置最小和最大高度
-
我现在不知道列表视图项的最小/最大高度是多少。它会因不同的设备而自动不同
标签: flutter dart flutter-layout