在 Android 中输入 edittext 时删除下划线
Remove the underlining when inputing into edittext in Android
我想在编辑文本中输入文本时删除下划线装饰。还有,是否可以去除输入文本和下方蓝色边框之间的填充或边距?
现在编辑文本看起来像这样:
使用以下代码在您的可绘制对象文件夹中创建一个 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"
字段设置为同一个可绘制文件。
editText.setBackroundDrawable(空);
我想在编辑文本中输入文本时删除下划线装饰。还有,是否可以去除输入文本和下方蓝色边框之间的填充或边距?
现在编辑文本看起来像这样:
使用以下代码在您的可绘制对象文件夹中创建一个 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"
字段设置为同一个可绘制文件。
editText.setBackroundDrawable(空);