How do I change the default color of the Android checkbox from green checkmarks to blue for a particular CheckBox?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately, changing the colour isn’t a simple attribute. The checkmark is an image, so you have to create a custom image. Take a look at this example
Create a selector xml file such as this:
save this xml file in your
res\drawables\folder. Then inside your layout file apply it to your checkBox like this:In this example you’d name your selector xml file “checkbox_selector.xml” and you’d need a star_down.png, and star.png in your drawables folder as well. You can use this technique to create different colored checkboxes by altering the system checkbox images to whatever color you want and referencing the altered png files in a selector.