flutter - 如何在颤振应用程序中剪切列表?
问题描述
我想制作一个笔记应用程序,但遇到了一个问题。当我不滚动列表时,它看起来很棒(对我来说)但是当我滚动它时,绿色背景移动到应用程序的顶部,我想剪切它并制作固定大小。我还想让这个列表更加自定义,在元素之间留出更大的边距并将形式更改为圆角矩形
body: Stack(
fit: StackFit.expand,
children: <Widget>[
Positioned(
top: 0.0,
child: Row(
children: <Widget>[
Container(
child: Text(
"Notes",
style: TextStyle(
color: Color.fromRGBO(107, 119, 141, 1),
fontSize: 72,
),
),
),
Container(
margin: EdgeInsets.only(top: 50),
child: Text(
"Never Settle",
style: TextStyle(
fontSize: 12,
color: Color.fromRGBO(107, 119, 141, 0.25),
),
),
),
SizedBox(width: 20),
Container(
child: Image.asset(
'assets/images/magnifier.png',
height: 44,
width: 44,
),
),
SizedBox(width: 30),
Container(
child: Image.asset(
'assets/images/3dot.png',
height: 44,
width: 44,
),
),
],
),
),
Positioned(
top: 75.0,
child: ListView.builder(
itemCount: dList.length,
itemBuilder: (context, index) {
return Ink(
color: Colors.green,
child: ListTile(
title: Text(
dList[index],
style: TextStyle(
fontSize: 25,
),
),
)
);
},
),
),
Positioned(
height: 55,
width: 55,
// top:0.0,
right: 20.0,
bottom: 20.0,
child: Image.asset(
'assets/images/plus.png',
height: 22,
width: 22,
),
),
],
),
),
);
}
}
解决方案
将背景颜色设置为绿色 ins 脚手架并将透明颜色设置为链接然后尝试
推荐阅读
- java - 为什么这段代码会给我错误“imageicon 无法转换为 int”?
- hololens - Hololens 感知模拟示例测试使设备崩溃
- java - JavaFX如何处理来自控制器类的ActionEvent?
- bash - 监视添加到目录的文件大小(Bash)
- c# - C#:分配自动属性时会发生什么?
- azure - 在 Azure AD 租户的 Azure 门户中将成员作为组所有者添加到组
- reporting-services - 在 SSRS 报告中将数字更改为分数
- javascript - 在 d3 中构建堆叠条形图时动态获取不同的颜色
- reporting-services - SSRS 中迷你图的条件格式/颜色
- c++ - C++ 将派生类的成员更改为其专用版本