checkbox大小調整 樣式設置

                    android:id="@+id/checkBox1"
            style="@style/CustomCheckboxTheme"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="10dp"
            android:clickable="false"
            android:focusable="false"
            android:focusableInTouchMode="false"
            android:scaleX="2"
            android:scaleY="2" >

        </CheckBox>


樣式:

    <style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
        <item name="android:button">@drawable/checkbox_style</item>


    </style>

下面是背景文件:

<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">


    <item android:drawable="@drawable/checkbox_pressed" android:state_checked="true"/>
    <item android:drawable="@drawable/nocheck" android:state_checked="false"/>
    <item android:drawable="@drawable/nocheck"/>


</selector>

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