编辑在文本上显示红色下划线的文本 [英] Edit text showing red underLine on the Text

查看:275
本文介绍了编辑在文本上显示红色下划线的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EditText从用户那里获取日期.因此,当我在给定默认值的情况下运行应用程序时,该文本用红色下划线突出显示. XML代码

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" />

在我的活动

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.

推荐答案

我认为这是您的拼写检查,因此添加:

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

android:inputType="textNoSuggestions"

这篇关于编辑在文本上显示红色下划线的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆