dart - 如何将提示文本对齐到文本字段的中心?

标签 dart flutter

我正在尝试为文本字段内的提示文本添加对齐方式。但它不起作用。如何把它带到中心?? 如何以曲线形式书写文字???

 Container(
           child: new TextFormField(
                       controller: _pass,
                       textAlign: TextAlign.center, 
                       decoration: new InputDecoration.collapsed(
                                             hintText: " PASSWORD", ), )),

最佳答案

在 TextFormField 或文本域中使用 textAlign: TextAlign.center,

这是代码

enter image description here

这样的输出

enter image description here

关于dart - 如何将提示文本对齐到文本字段的中心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49731910/

相关文章:

flutter - Dart 中的这个运算符 "?."是什么?

mysql - 如何使用flutter将下拉按钮值插入数据库mysql

list - Dart:.toList() 和转换为 List 有什么区别

flutter - Flutter中的 strip 是否可能同时具有 'expand'和 'contract'效果?

date - Dart : parse date timezone gives UnimplementedError

firebase - flutter 问题 : type 'Timestamp' is not a subtype of type 'DateTime'

dart - Flutter:Facebook 和 Google 身份验证

json - 如何获取带有对象列表的文档? -消防站

flutter - 如何在我们输入 flutter 的 TextField 小部件时格式化文本?

flutter - 应用程序在使用 flutter 构建发布 apk 时停止工作,但在 razorpay 网关打开时在模拟器中工作