Here is my AppCompatCheckBox
<androidx.appcompat.widget.AppCompatCheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="hello123"
android:theme="@style/MyCheckBox"
android:textColor="#ffffff" />
MyCheckBox
style
<style name="MyCheckBox" parent="AppTheme">
<item name="colorAccent">#ffff00</item> <--yellow
<item name="android:textColorSecondary">#ff00ff</item> <--purple
</style>
How to change the tick color
I have found many article on stackoverflow but doesn't work.
please help.
CodePudding user response:
Try This
<androidx.appcompat.widget.AppCompatCheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="hello123"
app:buttonTint="@color/colorAccent"
android:theme="@style/MyCheckBox"
android:textColor="#ffffff" />
checked = true https://prnt.sc/CGSUxigv9pmF
checked = false https://prnt.sc/sAgExyOoSUvf
CodePudding user response:
you can try this
app:buttonTint="@color/colorAccent"
for reference
<android.support.v7.widget.AppCompatCheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="hello123"
app:buttonTint="@color/colorAccent"
android:theme="@style/MyCheckBox"
android:textColor="#ffffff" />