[英]Flutter: Positioning images
这是我的应用程序:在此处输入图像描述
如您所见,我在中间有两张照片,如何将第二张照片移动到左上角这是我的代码
完整链接代码: https://pastebin.com/CwgsPx4a
children: <Widget> [
SizedBox(
height: 250,
child: Image.asset(
"assets/logo.png",
fit: BoxFit.contain,
)
),
SizedBox(
child: Image.asset(
"assets/top.png",
fit: BoxFit.contain,
)
),
使用堆栈:
Column(
children: [
Stack(
alignment: Alignment.topCenter,
children: [
SizedBox(
height: 250,
child: Image.asset(
"assets/logo.png",
fit: BoxFit.contain,
),
),
Positioned(
left: 0,
child: SizedBox(
child: Image.asset(
"assets/top.png",
fit: BoxFit.contain,
),
),
),
],
),
// other widgets...
],
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.