zoukankan      html  css  js  c++  java
  • Align

    控制子Widget对齐方式的Widget,包含以下属性:

    alignment

    表示子Widget的对齐方式,包括Alignment.topLeft、Alignment.topCenter、Alignment.topRight、Alignment.centerLeft、Alignment.center、Alignment.centerRight、Alignment.bottomLeft、Alignment.bottomCenter、Alignment.bottomRight等,和Container的alignment属性一样。

    widthFactor

    宽度因子,同Center的widthFactor属性一样,其实Center widget就是继承自Align widget,不过alignment值默认设置为了Alignment.center而已。

    heightFactor

    高度因子,同Center的heightFactor属性一样。

    Widget getAlign() {
        return Container(
          color: Colors.green,
          child: Align(
            alignment: Alignment.centerLeft,
            widthFactor: 3,
            heightFactor: 2,
            child: Container(
               100,
              height: 100,
              alignment: Alignment.center,
              color: Colors.redAccent,
              child: Text('This is Center widget demo'),
            ),
          ),
        );
      }
  • 相关阅读:
    Shell printf 命令
    Shell echo命令
    Shell 基本运算符
    Shell 数组
    Shell 传递参数
    Shell 变量
    Spark基础知识汇总
    DataScientist————汇总篇
    Java的Unsafe类
    java 中文字符和unicode编码值相互转化
  • 原文地址:https://www.cnblogs.com/timba1322/p/12487549.html
Copyright © 2011-2022 走看看