问题描述
使用TextFormField时,我试图隐藏输入文本的下划线。 我已经阅读了所有建议,但是都没有消除下划线!
child: TextFormField(
autocorrect: false,inputFormatters: [ new FilteringTextInputFormatter.allow(RegExp("[a-zA-Z0-9]"))],textAlign: TextAlign.center,decoration: Inputdecoration(
hintText: "i.e. noahsclearnews",hintStyle: TextStyle( color: Colors.grey,fontSize: ScreenUtil().setSp(40) ),border: InputBorder.none,focusedBorder: InputBorder.none,enabledBorder: InputBorder.none,errorBorder: InputBorder.none,disabledBorder: InputBorder.none,)
)
我想念什么吗?
解决方法
当您在键盘上独立于FormField键入未知单词时,这是一个本机下划线,实际上在您的应用程序中不是问题,而在android键盘中则是如此。
但是您可以忽略将键盘类型设置为TextInputType.visiblePassword的那些更正。
TextFormField(
autocorrect: false,keyboardType: TextInputType.visiblePassword,// Disabling word correction
decoration: InputDecoration(
hintText: "i.e. noahsclearnews",)
)
,
也许一个空格会起作用,在写作时给一个空格,我们的下划线将会被删除