• Flutter-stack層疊樣式


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

    多個元素定位

     Align

    var stack = new Container(
        height: 400,
         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,
         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,),
            ),
          ],
        ),
      );
  • 相关阅读:
    字符串转换整数 (atoi)
    Z 字形变换
    最长回文子串
    寻找两个有序数组的中位数
    二维码QRCode
    多个线程访问url
    store procedure 翻页
    store procedure example
    使用graphics2D给图片上画字符
    procedure的over(partition by ) function
  • 原文地址:https://www.cnblogs.com/ssjf/p/11812424.html
Copyright © 2020-2023  润新知