首先在drawable中创建一个Drawabler Resource file
直接复制下面的代码
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <solid android:color="#0500a0ff" /> <corners android:radius="22dp" /> <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" /> </shape> </item> <item> <shape android:shape="rectangle" > <corners android:radius="22dp" /> <solid android:color="#FFFFFF" /> </shape> </item> </layer-list>
之后给控件设置上看看效果是否满足你的需求,四周的光圈宽度都可以改变,自己试试吧~拜