天天看點

android select選擇器 checkbox改外觀,button按下狀态

android 可以用選擇器。來加載視圖。選擇器裡的選項也很多針對實際使用中用的幾個進行描述。

1、button 的按下彈起改外觀。選擇器屬性用 android:state_pressed

2、CheckBox  修改外觀。可以替換系統的勾勾。選擇器用屬性android:state_checked

2.1 選擇器  

2.2 checkbox調用:  重寫android:button 指定新外觀

<CheckBox

    android:id="@+id/chk_isSave"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:button="@drawable/select_ischeck"

    />

note: 沒有屬性行表示預設:

     <item 

     android:drawable="@drawable/total_station_button" />

轉載于:https://www.cnblogs.com/sucerli/p/4358449.html