我想将我的图像放在屏幕的顶部中央,在应用程序栏下方。我设法垂直移动它,但似乎无法水平移动它。
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 100,
height: 100,
margin: EdgeInsets.only(top: 30, bottom: 10),
padding: EdgeInsets.only(left: 100.0, top: 100.0, right: 100.0, bottom: 100.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage('https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png'),
fit: BoxFit.contain,
),
),
),
]
),
我已经尝试了一切(mainAxisAlignment、crossAxisAlignment、margin、padding)。它们似乎都不起作用。
你可以试试对齐。试试这个
Align(
alignment: Alignment.topCenter,
child: Column(
children: [
Container(
height: 100,
width: 150,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(
'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png'),
fit: BoxFit.fitWidth,
),
),
),
],
),
),
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句