當我嘗試向下滾動以查看整個文本時,我無法向下滾動。我認為問題在于 sizedbox 的高度。

我使用 sizedbox,因為如果我不使用上面的串列視圖構建器,那么它不會顯示任何內容。
代碼:
Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: ListView.builder(
shrinkWrap: true,
itemCount:
snapshotPosts.data?.data()!["random"]?.length,
itemBuilder: (context, index) {..})...
uj5u.com熱心網友回復:
在您使用的第一個 SizedBox 之后,您可以添加其他沒有孩子的 SizedBox,例如:
SizedBox(
height: 50,
),
或者為了回應任何螢屏,你可以使用這個:
SizedBox(
height: MediaQuery.of(context).size.height * 0.1,
),
通過這種方式,您可以添加空白區域以查看小部件上方。
uj5u.com熱心網友回復:
我在網路上沒有找到任何東西,但我是這樣解決的:我洗掉了Sizedbox,我放的是card而不是sizedbox。這當然是不夠的。我還洗掉了第二個 futureBuilder。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/345445.html
