我在一个大小的盒子里有一个SingleChildScrollView。我认为这将使我的页面滚动,但它不能。当我运行它时,我会得到它。

我有密码
Container(
width: double.infinity,
alignment: Alignment.centerLeft,
child: Column(
children: [
const SizedBox(
width: double.infinity,
child: some text
),
const SizedBox(height: 10),
SizedBox(
width: double.infinity,
child: SingleChildScrollView(
child: Column(
children: items
.map((e) => ListTile(
most recent items
))
.toList(),
),
)),
],
))发布于 2022-11-13 16:06:55
您需要用Expanded包装您的Expanded,因此SingleChildScrollView get available height in column,如下所示:
Expanded(
child: SizedBox(
width: double.infinity,
child: SingleChildScrollView(
...
),
),
)发布于 2022-11-13 16:06:47
包起来
Expanded(
child :SizedBox(
child :...
)
)或
SizedBox.expand(
)或者给出大小的盒子屏幕尺寸。
var screenWidth = MediaQuery.of(context).size.width
var screenHieght = MediaQuery.of(context).size.heightSizedBox(宽度: screenWidth,身高: screenHeight子:您的孩子在这里,)
https://stackoverflow.com/questions/74422538
复制相似问题