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,),
),
],
),
);

Flutter-stack層疊樣式的更多相关文章

  1. vue樣式綁定

    vue的樣式可以使得class,style不僅可以綁定文本,而且可以綁定數組和對象. 使用對象{} 使用數組 綁定對象 使用computed屬性, 使用內聯樣式.

  2. [转]利用 NPOI 變更字體尺寸及樣式

    本文转自:http://blog.cscworm.net/?p=1650 利用 NPOI 變更字體尺寸及樣式: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...

  3. flutter stack

    import 'package:flutter/material.dart'; void main() { runApp(MaterialApp(home: new MyApp())); } clas ...

  4. Flutter——Stack组件(层叠组件)、Align组件、Positioned组件

    Stack 表示堆的意思,我们可以用 Stack 或者 Stack 结合 Align 或者 Stack 结合 Positiond 来实现页面的定位布局. Stack组件 常用于两个子元素. Stack ...

  5. flutter stack嵌套,appbar透明,Container设置背景图片并且图片在appbar之下

    stack嵌套 一般情况下 stack是无法嵌套,出现stack嵌套,布局就会出乱 解决方式:就是第二个stack需要确定宽高 appbar透明 AppBar( backgroundColor: Co ...

  6. Flutter Stack布局中定位的方式

    前言 想要记录一下Stack布局中,定位的两种方式 代码 //……省略无关代码…… child: new Column( children: <Widget>[ new SizedBox( ...

  7. Flutter——Wrap组件(流式布局)

    Wrap 可以实现流布局,单行的 Wrap 跟 Row 表现几乎一致,单列的 Wrap 则跟 Row 表现几乎一致.但 Row 与 Column 都是单行单列的,Wrap 则突破了这个限制,mainA ...

  8. [Flutter] Stack Layout

    Normally if you place three the same size icons in a stack, they will stands on top of each other, t ...

  9. haroopad 預覽區樣式

    body { color:red; font-family:'Microsoft YaHei'; } html,body{ font-family: "微軟雅黑" !importa ...

随机推荐

  1. MyISAM、InnoDB、Memory这3个常用引擎支持的索引类型

    表格对比了MyISAM.InnoDB.Memory这3个常用引擎支持的索引类型: 索引 MyISAM引擎 InnoDB引擎 Memory引擎 B-Tree索引 支持 支持 支持 HASH索引 不支持 ...

  2. debugfs linux rm 删除 恢复 Attempt to read block from filesystem resulted in short read while opening filesystem

    w 删除具有空字符的文件 反斜杠来转义下一个字符 rm -R Samples\ -\ Copy well@well:/home/etc/project/apilinux/MarketplaceWebS ...

  3. 在sql中使用函数,遇到net.sf.jsqlparser.parser.ParseException异常

    异常详情如下 Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " "->" &quo ...

  4. VMware 虚拟化编程(9) — VMware 虚拟机的快照

    目录 目录 前文列表 VMware 虚拟机的快照 快照的执行过程 删除快照 快照类型 Quiseced Snapshot 前文列表 VMware 虚拟化编程(1) - VMDK/VDDK/VixDis ...

  5. VMware 虚拟化编程(1) — VMDK/VDDK/VixDiskLib/VADP 概念简析

    目录 目录 VMDK VDDK VixDiskLib VADP VMDK VMDK(VMware's Virtual Machine Disk Format,VMware 虚拟磁盘格式):简单来说就是 ...

  6. VMware vSphere 虚拟化简介

    目录 目录 vSphere 简介 vSphere 提供的工具 vCenter vCenter 的功能 vCenter 管理界面上提供的操作功能 HOST CLUSTER TEMPLATE Virtua ...

  7. 我的常用的Linux命令

    环境:centos7 主要应用Linux命令是为了搭建环境,所以记录一下我的常用的Liunx命令 一.常用目录.文件操作命令 1.显示目录列表命令 ls       显示当前目录下的可见文件 ls - ...

  8. 【ABAP系列】SAP WEB GUI的实现,SAP在网页中使用

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP WEB GUI的实现,SAP ...

  9. Linux 文件创建、插入、替换

    创建文件 touch newfile.txt 插入字符串 echo "aaa" >>/newfile.txt 替换字符串 sed -i "s/aaa/ccc/ ...

  10. [Python3 练习] 004 水仙花数

    题目:水仙花数 (1) 描述 水仙花数各位的数字的立方之和等于自身 如 153 为水仙花数,因为 153 = 1^3 + 5^3 + 3^3 (2) 要求 找到所有的三位数的水仙花数 (3) 程序 # ...