在颤振中,使用一个视图覆盖另一个视图堆栈小部件 https://docs.flutter.io/flutter/widgets/Stack-class.html。做工很好啊现在我需要在屏幕底部的左侧和右侧添加两个浮动按钮。我在右侧添加了一个按钮,但我不知道如何在左侧添加浮动按钮。简单如下图所示。
任何帮助都会很明显
您可以使用Align https://docs.flutter.io/flutter/widgets/Align-class.html小部件来定位您的FloatingActionButton's https://docs.flutter.io/flutter/material/FloatingActionButton-class.html in the Stack https://docs.flutter.io/flutter/widgets/Stack-class.html.
Stack(
children: <Widget>[
Align(
alignment: Alignment.bottomLeft,
child: FloatingActionButton(...),
),
Align(
alignment: Alignment.bottomRight,
child: FloatingActionButton(...),
),
],
)
一键使用常量Alignment.bottomLeft
为其alignment
财产和另一项分别Alignment.bottomRight
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)