alignment調整佈局
var stack = new Stack(
alignment: Alignment.center,//元素居中
//alignment: Alignment (1,1),//xy座標,可使用小數點
    children: <Widget>[
//按順序疊放
Container(
height: 300,
width: 300,
color: Colors.red,
),
Text('文字')
],
);

多個元素定位

Align

var stack = new Container(
height: 400,
width: 300,
color: Colors.blueAccent,
child: Stack(
children: <Widget>[
Align(
//alignment:Alignment.topLeft,
alignment:Alignment(1,2),
child: Icon(Icons.access_alarm,size: 30,color: Colors.red,),
),
Align(
alignment:Alignment.center,
child: Icon(Icons.access_alarm,size: 30,color: Colors.red,),
),
Align(
alignment:Alignment.bottomLeft,
child: Icon(Icons.access_alarm,size: 30,color: Colors.red,),
),
],
),
);
Positioned
var stack = new Container(
height: 400,
width: 300,
color: Colors.blueAccent,
child: Stack(
children: <Widget>[
Positioned(
top:1,
left: 1,
right: 1,
bottom: 1,
child: Icon(Icons.access_alarm,size: 30,color: Colors.red,),
),
Positioned(
top:1,
left: 1,
child: Icon(Icons.access_alarm,size: 30,color: Colors.red,),
),
Positioned(
right: 1,
bottom: 1,
child: Icon(Icons.access_alarm,size: 30,color: Colors.red,),
),
],
),
);

最新文章

  1. d-规则
  2. 初学者--bootstrap(三)下载与安装----在路上(7)
  3. SSH协议及其应用
  4. MySQL日常应用和操作记录
  5. BIP_开发案例08_BI Publisher图表示例 饼状图/直方图/折线图(案例)
  6. Swift - 本地消息的推送通知(附样例)
  7. html5实现渐变效果
  8. Redis源码研究--字符串
  9. (转)在Repeater中嵌套使用Repeater
  10. 开始我的.NET的学习旅程
  11. MyBatis之级联——一对一关系
  12. java 运行时常量、编译时常量、静态块执行顺序
  13. ios中pch文件的创建与配置
  14. Android设计模式总结
  15. toLatin1 qt
  16. flask 虚拟换将安装
  17. py文件的运行
  18. OpenLdap 对接内部系统(Gitlab+Wiki+Jumpserver+Openvpn)配置
  19. 《统计学习方法》笔记(3):k近邻
  20. Codeforces483B. Friends and Presents(二分+容斥原理)

热门文章

  1. Python List 列表list()方法
  2. DB数据库的基本操作
  3. react-native 组件之间传值
  4. mongoexport导出记录到csv文件
  5. duliu题之狼抓兔子题解
  6. write()与writelines()
  7. 38 是否要使用memory引擎的表
  8. Android安全测试(三)应用完整性检验检测
  9. 20191105 《Spring5高级编程》笔记-第6章
  10. [BZOJ2716] [Violet 3]天使玩偶(CDQ分治)