【问题标题】:Flutter - TextField "textAlign" property not foundFlutter - 找不到TextField“textAlign”属性
【发布时间】:2017-09-28 02:55:54
【问题描述】:

我有这个基本的文本字段:

          new TextField(
            style: new TextStyle(fontSize: 20.0, color: Colors.blue),
            onChanged: (InputValue newInputValue) {
              setState(() {
                inputValue = newInputValue;
            });
          }),

我现在想让文本在用户输入内容时浮动到中心。所以我去了文档,它告诉我使用 textAlign 属性。

              new TextField(
                textAlign: TextAlign.center;
                style: new TextStyle(fontSize: 20.0, color: Colors.blue),
                onChanged: (InputValue newInputValue) {
                  setState(() {
                    inputValue = newInputValue;
                });
              }),

但由于某种原因,Flutter 告诉我 TextAlign 属性不存在。

【问题讨论】:

标签: user-interface dart flutter


【解决方案1】:

我只需要升级 Flutter 就可以了。最近添加了 TextAlign...

【讨论】:

    猜你喜欢
    • 2019-01-09
    • 2020-12-21
    • 1970-01-01
    • 1970-01-01
    • 2021-02-21
    • 1970-01-01
    • 2020-10-10
    • 2018-05-06
    • 2021-05-19
    相关资源
    最近更新 更多