bravotango
Lurker
Hello Android experts. As a new starter in android I am finding it almost impossible to create a custom style checkbox. Maybe this is not possible.
I am using Eclipse for Java Developers Indigo Release with Android open source plugin.
I see lots of examples showing a pretty silver checkbox but what I am getting is a smaller dark gray checkbox no matter what version of android I choose for the project. I have searched a lot and have not found anyone else experiencing this problem.
If I try to customise the checkbox to make it look like the examples the black border outline of the unwanted built-in checkbox persists and is superimposed on my custom image style.
I have to use android:background="@layout/checkboxtheme" to get this to work at all. Using style="@layout/checkboxtheme" has no effect.
I would show an image to make this clearer but am not at liberty to do this yet as I have not made enough posts.
Here is my main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=""
androidrientation="vertical">
<CheckBox android:id="@+id/check1"
android:background="@layout/checkboxtheme"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<CheckBox android:id="@+id/check2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<Button android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Confirm Selection"/>
<TextView android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Selected is" />
<EditText android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EditText"
android:textSize="18sp"/>
</LinearLayout>
Here is my checkboxtheme.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="">
<item android:state_checked="true" android:state_focused="true"
android:drawable="@drawable/btn_check_off_pressed" />
<item android:state_checked="false" android:state_focused="true"
android:drawable="@drawable/btn_check_off_selected" />
<item android:state_checked="false"
android:drawable="@drawable/btn_check_off" />
<item android:state_checked="true"
android:drawable="@drawable/btn_check_on" />
</select
I am using Eclipse for Java Developers Indigo Release with Android open source plugin.
I see lots of examples showing a pretty silver checkbox but what I am getting is a smaller dark gray checkbox no matter what version of android I choose for the project. I have searched a lot and have not found anyone else experiencing this problem.
If I try to customise the checkbox to make it look like the examples the black border outline of the unwanted built-in checkbox persists and is superimposed on my custom image style.
I have to use android:background="@layout/checkboxtheme" to get this to work at all. Using style="@layout/checkboxtheme" has no effect.
I would show an image to make this clearer but am not at liberty to do this yet as I have not made enough posts.
Here is my main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=""
androidrientation="vertical">
<CheckBox android:id="@+id/check1"
android:background="@layout/checkboxtheme"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<CheckBox android:id="@+id/check2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<Button android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Confirm Selection"/>
<TextView android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Selected is" />
<EditText android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EditText"
android:textSize="18sp"/>
</LinearLayout>
Here is my checkboxtheme.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="">
<item android:state_checked="true" android:state_focused="true"
android:drawable="@drawable/btn_check_off_pressed" />
<item android:state_checked="false" android:state_focused="true"
android:drawable="@drawable/btn_check_off_selected" />
<item android:state_checked="false"
android:drawable="@drawable/btn_check_off" />
<item android:state_checked="true"
android:drawable="@drawable/btn_check_on" />
</select
