Edit text showing red underLine on the Text

别来无恙 提交于 2019-12-05 09:20:17

问题


I am using a EditText to take date from the user. So when I am running my application on the default value that I have given it is underlining the text in red. XML Code

<EditText
      android:id="@+id/setDate"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="5dp"
      android:gravity="center_horizontal"
      android:text="dd/mm/yyyy" />

And in my Activity

date.setFocusableInTouchMode(false);

Why does it underline the text in red? Once the date is set then it is not showing me the red underline.


回答1:


I assume, that this is your spell check, so add:

android:inputType="textNoSuggestions"


来源:https://stackoverflow.com/questions/18332694/edit-text-showing-red-underline-on-the-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!