zoukankan      html  css  js  c++  java
  • 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,),
            ),
          ],
        ),
      );
  • 相关阅读:
    生成流畅文本方法
    KNNImputer:一种可靠的缺失值插补方法
    SparseNN中的优化
    基于TorchText的PyTorch文本分类
    蒙特卡洛方法分析Web页面浏览量
    D. Segment Intersections 模拟
    B. Array Walk
    线性基 P3857 [TJOI2008]彩灯
    线性基 P4570 [BJWC2011]元素
    线性基的学习+总结
  • 原文地址:https://www.cnblogs.com/ssjf/p/11812424.html
Copyright © 2011-2022 走看看