一、先建一个圆角的shape文件:
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <cornersandroid:radius="10dp"/> <strokeandroid:width="1dp"android:color="#FF6238" /></shape>二、建立list文件:
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"><item android:drawable="@mipmap/ic_launcher"/> <item android:drawable="@drawable/shape"/></layer-list>三、直接引用:
<TextView android:gravity="center" android:background="@drawable/list" android:layout_width="match_parent" android:layout_height="50dp" android:textSize="16sp" android:textColor="#FF0000" android:text="按钮" />总结