flutter - Flutter 行列问题
问题描述
我在颤动中遇到 Rows 问题,我想将我的资产放在容器的底部,如何使用 Row 来做到这一点?我尝试了 mainAxisAlignment: MainAxisAlignment.end 和 cross.end 但不工作...
Widget build(BuildContext context) {
double wi = MediaQuery.of(context).size.width;
return Scaffold(
body: Container(
child: Column(
children: <Widget>[
Container(
color: Colors.blue,
width: wi,
height: 200,
),
Container(
width: wi,
height: 200,
color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
SvgPicture.asset('assets/escapa.svg', semanticsLabel: 'Flask', color: Colors.black, width: 100,height: 100,)
]
),
)
],
),
),
);
你可以在这里下载asset/image.svg http://filesharing24.com/d/DVh
解决方案
容器有属性对齐使用,你可以像这样使用它
alignment: Alignment(0.0, 0.0), // this means center, range is from -1 to +1
您需要将其设置为 Alignment(-1.0, 1.0) 或像这样使用它
alignment: Alignment.bottomRight,
你不需要玩行或列轴,容器属性就足够了。使用其中一种方法来获得准确的位置
推荐阅读
- oracle - 当按下默认插入记录按钮 oracle 表单时触发
- python - 字段不存在错误(使用 odoo 12)
- python - askopenfiledialog 加载许多picke文件并将它们转换为一个Dataframe
- asp.net-core-3.1 - 需要了解如何以一种形式创建用户并为其分配角色(ASP.NET Core MVC 3+)
- windows - 为安全文件指定权限路径或权限分配失败....'得到'0o655'而不是'0o0600'
- python - 在 python 上比较来自 2 个数据框的 2 列
- php - 如果数据丢失,饼图问题不显示
- mysql - MySQL左连接查询不返回具有空值的行
- r - 创建起始值为 0 并从那里滞后的滞后列
- python - 如何解决 AttributeError:类型对象“StartPage”没有属性“ICID”?Aka 如何引用另一个类的变量?