0

Im trying to change the border color, radius etc of Material Check box in styles.xml but it doesn't get changed.

Checkbox XML:

 <com.google.android.material.checkbox.MaterialCheckBox
            android:id="@+id/password_checkbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/password_edtxt"
            android:layout_marginStart="14dp"
            android:layout_marginTop="20dp"
            android:minHeight="48dp"
            android:text="@string/remember_me"
            android:textColor="@color/chinese_black"
            android:textSize="16sp"
            android:theme="@style/MyCheckBox" />

Styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!--    CheckBox-->
        <style name="MyCheckBox" parent="Widget.Material3.CompoundButton.CheckBox">
            <item name="boxStrokeColor">#FFFFFF</item>
            <item name="boxStrokeWidth">2dp</item>

            //I tried both not working
<!--            <item name="colorControlNormal">#FFFFFF</item>   &lt;!&ndash; normal border color change as you wish &ndash;&gt;-->
<!--            <item name="colorControlActivated">#FFFFFF</item>-->
    </style>
</resources>
Sky
  • 127
  • 9
  • Does this answer your question? [How to change the color of a CheckBox?](https://stackoverflow.com/questions/5854047/how-to-change-the-color-of-a-checkbox) – deadfish Apr 08 '23 at 21:28
  • no it doesn't, that changes the checkbox color.. I want to change only the border color – Sky Apr 09 '23 at 14:24

0 Answers0