2014-05-22 41 views
0

我想增加複選框中支票的大小。我在想,我添加一張圖片作爲新的檢查。但是我沒有看到XML中的任何選項來更改複選框的檢查。是否有我缺少的XML選項或將新的檢查圖像添加到java的方法。增加複選框中的支票大小

回答

1
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > 
<item android:drawable="@drawable/checkbox" android:state_checked="false"/> 
<item android:drawable="@drawable/checkboxselected" android:state_checked="true"/> 
<item android:drawable="@drawable/checkbox"/>  

將它添加到您的複選框中的XML

<CheckBox 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       **android:button="@drawable/checkbox_selector"** 
       android:text="CheckBox" 
       android:textAppearance="?android:attr/textAppearanceLarge" 
       android:textColor="@color/Black" />