Android 帶邊框的圓角矩形
阿新 • • 發佈:2019-02-01
效果:
程式碼:
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>
使用:
android:background="@drawable/rectangle"