自定drawable

自定drawable的時候,可能會遇到各種奇葩的需求,但是我們可以通過自定義一個selector.xml文件來實現。

比如:自定義

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <bitmap android:src="@drawable/column_default_image"  />
        <shape android:shape="rectangle">
            <corners android:radius="5dp" />
        </shape>
    </item>
</selector>

 

1

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