【发布时间】:2022-11-19 21:23:03
【问题描述】:
我有一个关于 flutter 图像的问题。我有一个 Column,里面有一个图像,我需要将它拉伸到全宽,但我做不到。屏幕末端的白色圆圈左右留有几个空格。我的代码中的错误语句在哪里?
谢谢,
home: Scaffold(
backgroundColor: HexColor(primary),
body: SafeArea(
bottom: false,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Header text & Pawline image
Row(
...
),
// Banner image
Row(...
),
// Circle
// TODO: Stretch circle image to the both ends
Expanded(
child: Image.asset(
"assets/images/circle.png",
fit: BoxFit.contain,
),
),
],
),
),
),
);
编辑:圆形图像:
【问题讨论】:
-
你也可以在这里添加你的图片吗?我认为图像有边框。
-
没有边框,但小于屏幕宽度
-
也可以在这里添加图像文件吗?
-
这回答了你的问题了吗? How to fit an Image to column width in Flutter?
-
添加@eamirho3ein,很难看到,但它就在手机屏幕下方。