如何解决颤振堆叠/对齐
在堆栈中对齐会给我带来我不明白的结果。
代码如下:
Container(
height: totalHeight,child: Stack(
children: [
Align(
alignment: Alignment.topCenter,child: Container(
width: avatarSize,height: avatarSize,decoration: BoxDecoration(
shape: BoxShape.circle,image: DecorationImage(
image: imageProvider,fit: BoxFit.cover,)
),),Align(
alignment: Alignment.bottomCenter,child: Container(
width: 35,height: 20,color: Colors.yellow,)
],);
无论我做什么,黄色容器始终显示在左下方。 我想把它放在底部中心。
avatarSize当然大于35。我放置了一个外部容器,以使堆栈扩展到该外部父级。看起来很自然,但不起作用。很奇怪。
我在这里想念什么?
解决方法
定位堆栈中最好的将窗口小部件对齐的窗口小部件。我认为它可以解决您的问题
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。