gpt4 book ai didi

user-interface - GridView 元素在主屏幕上被裁剪了吗?

转载 作者:行者123 更新时间:2023-12-03 04:59:54 25 4
gpt4 key购买 nike

我在主屏幕上有一个可滚动的网格 View ,其中包含一些容器。但是,此网格 View 由于包装在其中的容器的高度而被裁剪。容器是列的一部分,而列又是堆栈的一部分。

最佳答案

使用Expanded

Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 20),
Text(
"Hello,",
style: TextStyle(
fontFamily: "Netflix",
fontWeight: FontWeight.w600,
fontSize: 32,
letterSpacing: 0.27,
color: Color(0xFFFF8C3B).withOpacity(0.7),
),
),
SizedBox(height: 4),
name(context),
SizedBox(height: 40),
Text(
"Home",
style: TextStyle(
fontFamily: "Netflix",
fontWeight: FontWeight.w600,
fontSize: 35,
letterSpacing: 0.27,
color: Color(0xFFFF8C3B),
),
),
SizedBox(height: 15),
Expanded( //TODO: Use Expanded here
child: GridView.builder(
itemCount: homeList.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, mainAxisSpacing: 20,
),
itemBuilder: (ctx, i) {
return GestureDetector(
onTap: () {
if (i == 0) {
_interstitialAd.show();
} else if (i == 1) {
FlutterPollfish.instance.show();
} else if (i == 2) {
sendInvite();
}

关于user-interface - GridView 元素在主屏幕上被裁剪了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59750867/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com