在Android中输入edittext时删除下划线

在Android中输入edittext时删除下划线,android,android-edittext,android-styles,Android,Android Edittext,Android Styles,当我在编辑文本中输入文本时,我想删除下划线装饰。还有,有没有可能去掉输入文本和下面蓝色边框之间的空白或边距 现在,编辑文本如下所示: 使用以下代码在drawables文件夹中创建一个编辑\u text\u background.xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape

当我在编辑文本中输入文本时,我想删除下划线装饰。还有,有没有可能去掉输入文本和下面蓝色边框之间的空白或边距

现在,编辑文本如下所示:


使用以下代码在drawables文件夹中创建一个
编辑\u text\u background.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="@android:color/white"></solid>

</shape>


然后只需将
android:background=“@drawable/edit\u text\u background”
字段设置为同一个可绘制文件。

editText.setBackroundDrawable(null)

尝试使用xml,或通过编程编辑TEXT.setInputType(InputType.TYPE\u TEXT\u FLAG\u NO\u建议)@谢谢你。它就像一个符咒!这就去掉了蓝色的下划线。我想要那个下划线。我不想要的是正在输入的文本下的灰色部分。