1.android:background 属性
指定控件背景
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="text"
android:background="@drawable/editor_selector" />
2.drawable 资源文件
配置样式属性
editor_selector.xml
shape_edit_normal.xml
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
android:left="2dp"
android:right="2dp"
android:top="2dp"/>
shape_edit_focus.xml
与shape_edit_normal.xml 差别不大
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp"/>
android:left="2dp"
android:right="2dp"
android:top="2dp"/>
3.效果如下
很丑,但是很温柔。
原文:http://www.cnblogs.com/mojo/p/7390257.html