How to remove the underline from the EditText field in Android?

后端 未结 10 1154
心在旅途
心在旅途 2020-12-14 14:47

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.

10条回答
  •  太阳男子
    2020-12-14 15:02

    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.

提交回复
热议问题