溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

自定義的ChecBox 樣式

發(fā)布時(shí)間:2020-10-12 14:59:55 來源:網(wǎng)絡(luò) 閱讀:743 作者:風(fēng)清揚(yáng)lfg 欄目:移動(dòng)開發(fā)

.xml里面

<CheckBox

        android:id="@+id/checkBox1"

        android:layout_width="29dp"

        android:layout_height="29dp"

        android:layout_alignBaseline="@+id/textView1"

        android:layout_alignBottom="@+id/textView1"

        android:layout_alignParentRight="true"

       

        android:layout_marginRight="10dp" />

   

      style 里面

       

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

     <item name="android:button">@drawable/checbox_style</item>  

     </style>

drawable上:

    

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@drawable/check" android:state_checked="true"/>  

    <item android:drawable="@drawable/check_all_pressed" android:state_checked="false"/>  

    <item android:drawable="@drawable/check_all_pressed"/>  

</selector>


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI