flutter - 颤动:将小部件对齐/固定到行的底部
问题描述
如何将所有项目对齐到Row
颤振的底部?我有一个小部件,Row
它在运行时改变它的高度,因此,Row
自动居中的所有其他小部件也是如此。我的问题是:如何防止这些其他小部件移动并将它们固定在底部?
解决方案
您正在寻找的是CrossAxisAlignment
:
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Container(width: 100, height: 200, color: Colors.red),
Container(width: 100, height: 300, color: Colors.blue),
SizedBox(
width: 100,
height: 150,
child: FittedBox(
fit: BoxFit.contain,
child: const FlutterLogo(),
),
),
],
)
推荐阅读
- android - 如何使用 Volley 解析数组中的 JSON 数组?
- r - 如何使用 R 中的线性回归预测未来值
- maps - RentFaster Scalable Map View 连接到数据库
- javascript - 为什么我在 Javascript 中创建新窗口时无法从 JSON 文件加载图像
- java - 将多个源流连接到同一组分支
- sql - 确定三角形的类型
- python - Python:如何删除字典中的符号?
- java - 在 MacOS 中使用 Java 程序执行 mysqldump
- spring - Tomcat 服务未正确重启
- java - 引起:java.lang.NoClassDefFoundError: com/amazonaws/auth/BasicAWSCredentials