0

I am using my checkbox with android api-11 as below

<CheckBox
            android:id="@+id/notifs"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="5dp"
            android:text="Enabled" 
            android:textColor="#ffdc143c"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:gravity="center"
            />

What I want is to only change the background color of the selection box to some other color as it is appearing transparent in my app.

How can I achieve this?

morten.c
  • 3,414
  • 5
  • 40
  • 45
karan
  • 8,637
  • 3
  • 41
  • 78
  • 2
    Check out http://stackoverflow.com/questions/7783787/how-to-change-default-images-of-checkbox: you can set drawables for all checkbox states. Drawables might be pictures or shapes, so you are free to set any background that you want to have. – Trinimon Mar 09 '13 at 22:10
  • after reading to article is that i have to make another xml for this but what it actually does i am not getting that... – karan Mar 09 '13 at 22:18
  • Have you tried to add `android:background`, e.g. `android:background="#ff0000"` – Trinimon Mar 09 '13 at 22:26
  • @André i dont want to change the background of the whole checkbox...i want to do is to change the background of the square box within my checkbox – karan Mar 09 '13 at 22:42
  • Ok, then my first idea was the right one: there no other way than replacing the drawables; check https://github.com/ChristopheVersieux/HoloEverywhere and in particular http://android-holo-colors.com/ - good luck! – Trinimon Mar 10 '13 at 11:03

0 Answers0