Flutter-最簡單的 Stack 使用範例

背景知識

有使用到 Container 可參考Flutter-最簡單的 Container 使用範例

官方說明頁面

本文 source code

介紹內容

Stack 可以堆疊放置多個物件,使物件之間互相重疊顯示

Stack(
      children: <Widget>[
        Container(
          width: 100,
          height: 100,
          color: Colors.red,
        ),
        Container(
          width: 90,
          height: 90,
          color: Colors.green,
        ),
        Container(
          width: 80,
          height: 80,
          color: Colors.blue,
        ),
      ],
    );
  alignment 測試
centerStartcentercenterEnd
bottomStartbottomCenterbottomEnd
topStarttopCentertopEnd

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *