简体   繁体   中英

Unable to hide text underline in TextFormField

I am trying to hide the underline of the entered text when using the TextFormField. I have read all of the suggestions, but none of them eliminate the underline!

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,
  )
)

Am I missing something?

示例截图

That's a native underline when you are typing unknown words in your keyboard independently of the FormField, actually isn't a thing in your app but in the android keyboard.

But you can ignore those corrections setting the keyboardType as a TextInputType.visiblePassword.

TextFormField(
    autocorrect: false,
    keyboardType: TextInputType.visiblePassword, // Disabling word correction
    decoration: InputDecoration(
      hintText: "i.e. noahsclearnews",
    )
)

也许一个空格会起作用,在写作时给一个空格,你的下划线将被删除

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM