gpt4 book ai didi

dart - 如何在 Flutter 中隐藏 TextField 底部的字母计数器

转载 作者:IT老高 更新时间:2023-10-28 12:29:23 34 4
gpt4 key购买 nike

enter image description here

我遇到了一个小问题。如您所见,我在 Flutter 中设置了 TextField 的 maxLength 1,但我无法隐藏文本计数器的底部标签。

最佳答案

要在使用 maxLength 属性时从 TextFieldTextFormField 小部件中隐藏计数器值,请尝试以下操作:

TextField(
decoration: InputDecoration(
hintText: "Email",
counterText: "",
),
maxLength: 40,
),

在此,我在 InputDecoration 属性中将 counterText 属性设置为空值。希望它会有所帮助。

关于dart - 如何在 Flutter 中隐藏 TextField 底部的字母计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51893926/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com