Android drawable shape绘制边框

自己用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来控制边框的大小!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章