Edit text showing red underLine on the Text

2019-04-18 01:23发布

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条回答
倾城 Initia
2楼-- · 2019-04-18 02:02

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

android:inputType="textNoSuggestions"
查看更多
登录 后发表回答