到了高版本的EditText一般没有边框,只有一条横线,需要自己加,代码如下;
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="请填入账号"
android:selectAllOnFocus="true"
android:background="@drawable/bg_border"
/>
其中 bg_border.xml 的代码如下:
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#ffffff"/>
<stroke android:width="1dip" android:color="#00ff00"/>
</shape>
<solid>标签表示填充色,不能省略否则默认为黑色。<stroke>控制边框颜色和边框粗细。