【问题标题】:Flutter: OutlineInputBorder input border text colorFlutter:OutlineInputBorder 输入边框文字颜色
【发布时间】:2021-06-29 12:18:01
【问题描述】:

我试图为我的文本字段构建一个边框,例如:

TextFormField(
    style: TextStyle(
    color: Colors.black,
    fontSize: 16,
    ),
    decoration: InputDecoration(
        border: OutlineInputBorder(),
        labelText: 'username',
        hintStyle: TextStyle(
            color: Color(0xFF262AAA),
        ),
        fillColor: Color(0xFF262AAA),
        focusedBorder:OutlineInputBorder(
            borderSide: const BorderSide(color: Color(0xFF262AAA), width: 2.0),
            borderRadius: BorderRadius.circular(25.0),
        ),
    ),
),

它适用于边框颜色,但边框文本颜色无法更改。 https://prnt.sc/112fu69 检查此链接。显示为白色的文本不能改变我们的放置颜色。

我该如何解决?

【问题讨论】:

    标签: flutter dart text flutter-animation flutter-text


    【解决方案1】:

    也许添加大小的框小部件。如果它不起作用,请发布所有代码,我可以尝试一下。

    【讨论】:

    • 感谢您的回复。我发现了问题,没有使用 labelStyle。
    • labelStyle: TextStyle(color: Color(0xFF262AAA), ),
    猜你喜欢
    • 1970-01-01
    • 2021-11-20
    • 2011-08-27
    • 1970-01-01
    • 1970-01-01
    • 2023-01-07
    • 1970-01-01
    • 1970-01-01
    • 2021-11-16
    相关资源
    最近更新 更多