2015-06-22 82 views
0

我想在将文本输入到我的编辑文本中时删除下划线装饰。还有更多,是否有可能摆脱输入的文本和它下面的蓝色边框之间的填充或边距?在Android中输入edittext时删除下划线

眼下EditText上看起来是这样的:

enter image description here

+0

post ur xml plz –

+1

尝试在xml中,或编程方式edittext.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); – Raghavendra

+0

@Raghavendra谢谢你。它像一个魅力! –

回答

0

创建您可绘制一个edit_text_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_text_background"场相同的绘制文件。

-1

editText.setBackroundDrawable(null);

+0

这删除了蓝色下划线。我想要强调。我不想要的那个是正在输入的文本下的灰色文本。 –