布局文件view
只要注意其中的android:background就可以了
<EditText
android:id="@+id/et_login_phone"
style="?android:attr/textViewStyle"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/edit_select"
android:gravity="center"
android:hint="电话"
android:inputType="phone"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:selectAllOnFocus="true"
android:singleLine="true"
android:textSize="12sp" />
drawable文件夹下 edit_select.xml文件
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:drawable="@drawable/edit_login_focus"></item>
<item android:state_window_focused="false" android:drawable="@drawable/edit_login_unfocus"></item>
</selector>
edit_login_focus.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="3dip"/>
<solid android:color="#FFFFFF"/>
<stroke android:width="1dip"
android:color="#f8560f"/>
</shape>
edit_login_unfocus.xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="3dip"/>
<solid android:color="#FFFFFF"/>
<stroke android:width="1dip"
android:color="#FFFFFF"/>
</shape>