效果:
代碼:
rectangle.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 填充顔色 -->
<solid android:color="#8d7eb9" />
<!-- 圓角度數 -->
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
<!-- 邊框 -->
<stroke
android:width="2dp"
android:color="#463281" />
</shape>
使用: