自己用xml实现shape,需要绘制边框,最后的结果如下!
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:right="0dp"> <shape android:shape="rectangle" > <solid android:color="@color/greennormal" /> </shape> </item> <item android:right="1dp" android:top="1dp" android:left="1dp" android:bottom="1dp"> <shape android:shape="rectangle" > <solid android:color="@color/white" /> </shape> </item> </layer-list>
主要思想就是下边线铺一层需要边框颜色的背景图,然后上面加上需要的背景 用right left top bottom来控制边框的大小!