How to change the check box (tick box) color to white in android XML

Is there any way to change the check box (tick box) color to white in android XML.(I need white color tick box which contain black tick,as the preview I got in android studio inside my real device)

Here is my code for check box

  • FileProvider Not Working with Camera
  • How to remove TextView top margin?
  • Android “Best Practice” use of Intents
  • How to prevent the activity from loading twice on pressing the button
  • How can we work-around the blank title in PagerTitleStrip and PagerTabStrip?
  • java.lang.NoClassDefFoundError $$inlined$forEach$lambda$1 in Kotlin
  •  <CheckBox
            android:textSize="15sp"
            android:textColor="#fff"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Save Loging "
            android:id="@+id/checkBox"
            android:layout_below="@id/PasswordeditText"
            android:checked="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:buttonTint="#fff"/>
    

    When I add android:buttonTint=”#fff” preview show the change I need,but it doesn’t work in real device

    Design preview

    enter image description here

    Real Device

    enter image description here

    Is there any attribute like android:buttonTint which I can use to achieve the changes in real device.

  • Difference between Phonegap and Sencha Touch
  • intent.putExtra() in pending intent not working
  • Activating Network Location Provider in the Android Emulator?
  • Pdf viewer api/library for android app?
  • Run Callback On Main Thread
  • Crop square image to circle - Programmatically
  • 4 Solutions collect form web for “How to change the check box (tick box) color to white in android XML”

    Set the colorAccent to your desired color:

    <style name="AppTheme" parent="Theme.AppCompat">
        <item name="colorAccent">#fff</item>
    </style>
    

    Or if you don’t want to change your main theme, create a new theme and apply it only to the checkbox:

    <style name="WhiteCheck">
        <item name="colorAccent">#fff</item>
    </style>
    

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:theme="@style/WhiteCheck"/>
    

    This is variation of tachyonflux’s answer:

    Try to change buttonTint:

    <style name="my_checkbox_style">
        <item name="buttonTint">#fff</item>
    </style>
    
    <CheckBox
                android:id="@+id/my_checkbox"
                style="@style/my_checkbox_style"
                android:background="#000" />
    

    easily we can change checkbox color by using this property in xml

    <CheckBox
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:buttonTint="@color/COLOR_WHICH_YOU_WANT" />
    

    Try this

    <CheckBox
        android:textSize="15sp"
        android:textColor="#fff"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Save Loging "
        android:id="@+id/checkBox"
        android:layout_below="@id/PasswordeditText"
        android:checked="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:button="@android:drawable/checkbox_on_background" />
    

    if CheckBox checked, else in android:button= write "@android:drawable/checkbox_off_background"

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.