Flutter-stack層疊樣式
- 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層疊樣式的更多相关文章
- vue樣式綁定
vue的樣式可以使得class,style不僅可以綁定文本,而且可以綁定數組和對象. 使用對象{} 使用數組 綁定對象 使用computed屬性, 使用內聯樣式.
- [转]利用 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 ...
- flutter stack
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp(home: new MyApp())); } clas ...
- Flutter——Stack组件(层叠组件)、Align组件、Positioned组件
Stack 表示堆的意思,我们可以用 Stack 或者 Stack 结合 Align 或者 Stack 结合 Positiond 来实现页面的定位布局. Stack组件 常用于两个子元素. Stack ...
- flutter stack嵌套,appbar透明,Container设置背景图片并且图片在appbar之下
stack嵌套 一般情况下 stack是无法嵌套,出现stack嵌套,布局就会出乱 解决方式:就是第二个stack需要确定宽高 appbar透明 AppBar( backgroundColor: Co ...
- Flutter Stack布局中定位的方式
前言 想要记录一下Stack布局中,定位的两种方式 代码 //……省略无关代码…… child: new Column( children: <Widget>[ new SizedBox( ...
- Flutter——Wrap组件(流式布局)
Wrap 可以实现流布局,单行的 Wrap 跟 Row 表现几乎一致,单列的 Wrap 则跟 Row 表现几乎一致.但 Row 与 Column 都是单行单列的,Wrap 则突破了这个限制,mainA ...
- [Flutter] Stack Layout
Normally if you place three the same size icons in a stack, they will stands on top of each other, t ...
- haroopad 預覽區樣式
body { color:red; font-family:'Microsoft YaHei'; } html,body{ font-family: "微軟雅黑" !importa ...
随机推荐
- android 摇一摇功能的实现
将这个功能封装成了一个类,这样今后方便调用 package com.bobo.myyaoyiyaotest; import android.R.bool; import android.content ...
- 大数据笔记(九)——Mapreduce的高级特性(B)
二.排序 对象排序 员工数据 Employee.java ----> 作为key2输出 需求:按照部门和薪水升序排列 Employee.java package mr.object; impo ...
- React Native商城项目实战11 - 个人中心头部内容
1.创建MineHeaderView.js /** * 个人中心头部内容 */ import React, { Component } from 'react'; import { AppRegist ...
- CAS-4.2.7接入REST登录认证,移动端、C/S端登录解决方案
一.发送GET请求获取RSA公钥和JSESSIONID 请求地址:/cas/login,请求类型:GET curl -I http://cas.gfstack.geo:8080/cas/login 返 ...
- WinForm实现最小化右下角
首先,要在窗体里面加入这么两个控件,左边的是托盘控件,右边的是菜单控件. 然后设置窗体的FormClosing事件: if (e.CloseReason == CloseReason.UserClos ...
- fedora23禁用不需要的服务?--systemd服务单元?
sign up: 签约; 登记, 注册. i'll sign up and go to the front and fight. he persuaded the company to sign up ...
- java 操作hdfs(连接HDFS)
FileSystem fs = null; Configuration conf = null; @Before public void init() throws Exception{ conf = ...
- java实现多种加密模式的AES算法-总有一种你用的着
https://blog.csdn.net/u013871100/article/details/80100992 AES-128位-无向量-ECB/PKCS7Padding package com. ...
- KVM 虚拟化架构和实现原理
目录 目录 KVM虚拟化架构 devkvm QEMU OpenstackKVMQEMU 的关系 KVM的虚拟化实现 KVM虚拟化架构 KVM是嵌入在Linux操作系统标准内核中的一个虚拟化模块,它能够 ...
- Delphi MlSkin V1.1 发布啦! 它能让你的程序拥有像QQ一样多彩炫丽的外观!
http://bbs.csdn.net/topics/390740239 本帖最后由 u014161811 于 2014-03-24 09:46:40 编辑 QQ皮肤透明TEdit透明TMemo图片按 ...