ximsfei / Android-skin-support

Android-skin-support is an easy dynamic skin framework to use for Android, Only one line of code to integrate it. Android 换肤框架, 极低的学习成本, 极好的用户体验. "一行"代码就可以实现换肤, 你值得拥有!!!
MIT License
6.42k stars 1.08k forks source link

CheckBox换肤无效 #455

Closed juyao closed 3 years ago

juyao commented 3 years ago

这是我的布局文件

<CheckBox
            android:id="@+id/checkbox"
            android:layout_width="30dp"
            android:layout_height="30dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:button="@drawable/button_checked"
            android:buttonTint="@color/checkbox_tint"/>

这是checkbox_tint.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/main_grey"
        android:state_checked="false"/>
    <item android:color="@color/maineventcolor"
        android:state_checked="true"/>
</selector>

这是颜色资源文件

 <color name="maineventcolor">#466DA9</color>
   <color name="maineventcolor_red">#ff0000</color>

应用内换肤后,maineventcolor_red这个色值checkbox没有生效

juyao commented 3 years ago

看了下源码,android:buttonTint="@color/checkbox_tint" 改成app:buttonTint="@color/checkbox_tint"可以了