Android:怎样隐藏EditText控件的下划线

来源:互联网 发布:摄像头阅卷软件 编辑:程序博客网 时间:2024/06/14 08:03

   在Android开发中,EditText是经常使用的控件,EditText中自带有一些默认的属性,如红色光标和红色下划线等。有时我们不想要EditText自带的红色下划线属性,这时就需要隐藏其默认属性。

    怎样才能隐藏EditText自带的红色下划线呢 ? 其实非常简单,只是添加这样一个属性即可:

    android:background="@null"


    完整代码如下:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">    <EditText        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:gravity="center"        android:background="@null" /></RelativeLayout>

0 0
原创粉丝点击