2

I'm developing a application for Android v2.1 and I search how I can change the color of the "check" for a CheckBox component?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
righettod
  • 225
  • 1
  • 3
  • 15

2 Answers2

0

Me faced same Problem , got solutions using below Technic

Copy the btn_check.xml from android-sdk/platforms/android-#(version)/data/res/drawable to your project's drawable folder and change the 'on' and 'off' image states to your custom images.

Then your xml will just need android:button="@drawable/btn_check"

<CheckBox
    android:button="@drawable/btn_check"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:checked="true" />

If you want to use different default android icons, you can use android:button="@android:drawable/...".

Eric Tobias
  • 3,225
  • 4
  • 32
  • 50
sravan
  • 5,303
  • 1
  • 31
  • 33
0

You can't. The check box is drawn as an image.

That means there is no way to change the appearance of the check box, apart from modifying the graphics and bundling with your app. Look insode android-sdk-linux_86/platforms/android-8/android.jar in /res/drawable-hdpi/ .

There you find btn_check_*.png which you must modify and then follow instructions stated here: Custom checkbox image android .

Community
  • 1
  • 1
Jacob Nordfalk
  • 3,533
  • 1
  • 21
  • 21