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來控制邊框的大小!

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