我在flutter中使用一个Card小部件来显示文本。我希望使用资源图像作为卡片的背景/纹理,并在顶部显示文本。我很难弄清楚如何正确地对小部件进行分层。任何洞察力都是非常值得欣赏的。
发布于 2019-01-29 10:44:11
这样做:
Card(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("images/image.png"),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
),
child: Text("YOUR TEXT"),
),
),https://stackoverflow.com/questions/54412802
复制相似问题