【发布时间】: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 属性不存在。
【问题讨论】:
-
你在做什么?
textAlign好像是一个月前才添加的:github.com/flutter/flutter/commit/… -
是的,升级解决了这个问题..可以考虑一下,谢谢
标签: user-interface dart flutter