Avoiding Underline & Password Utilities With EditText

Nathan Sokalski 4,111 Reputation points
2022-04-22T03:15:07.24+00:00

I have several EditText(s) for which I want to remove the underlining of the text. I have already set the background property of the EditText, but the text itself still gets underlined when the user starts typing. I am currently using:

android:inputType="textNoSuggestions|textVisiblePassword|textCapWords"

However, this causes some devices to ask the user if they want to save the password (which I obviously do not want, since it is not a password field). To put it simply, I want to the text to look the same as it would in a TextView (which I would assume is possible, since EditText inherits from TextView). Is there any simple way to do this? Thanks.

Developer technologies .NET Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-04-25T06:47:02.01+00:00

    Hello,

    However, this causes some devices to ask the user if they want to save the password

    Because you set textVisiblePassword, it means the password is visible in this field, try to remove textVisiblePassword.

    If you want to remove the underline of EditText, try to set android:backgroundTint="@android:color/transparent"

    But your main purpose is to remove the underline in text itself, that's the autocorrection (like username fields, family names and so on). I have to say, we can't disable Text correction by EditText, you can try to turn off Text correction under Settings->System->Language&Input-> On-screen keyboard->GBoard

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.