Whenever a word is typed in the EditText box, I always see an underline under the word being typed. But when I press a space after that word I no longer see the underline.
There is a function that removes any composing state. I think if you call it after every time a user types, you will not see the underline. I use it after the user finishes typing, to get the drawing cache of the entire textView (which I need without underline). It's
someTextView.clearComposingText();
Use this from your class, if EditText view is dynamic (created from class file):
EditText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
OR include android:inputType="textNoSuggestions"
with your EditText in XML.
android:inputType="textNoSuggestions"
Read this if you want to keep emojis and textNoSuggestions
doesn't work for you.
textNoSuggestions
does not work in every keyboard.
inputType="textVisiblePassword"
works but it removes emoji's from most keyboards.
I found that setting inputType="textUri"
works and keeps the ability to add emojis.
You can set the EditText to have a custom transparent drawable or just use android:background="@android:color/transparent".
The best solution for this is to add on your EditText
:
android:inputType="textMultiLine|textVisiblePassword"