I am attempting to style a radio button and so I created a selector. Everything works except the standard radio button image still shows up. How do I remove the default radio button checkbox. I tried assigning the drawable to an empty string, but the compiler does not like it.
Here is the code of one of my selector states:
<item android:state_checked="true" android:drawable="">
<shape>
<gradient
android:startColor="#808080"
android:centerColor="#2F2F2F"
android:endColor="#2F2F2F"
android:angle="270" />
<stroke
android:width="2dp"
android:color="@color/black" />
<corners
android:radius="5dp" />
</shape>
</item>
I found that I cannot remove the default radiobutton checkbox in the selector. I found that it can be removed by assigning the “button” property to null, in either the style or the definition of the radiobutton itself.
Here is an example using a style.
radiobutton_selector defines a selector that draws the button in its different checked states. Here is the checked state: