Reputation: 2409
In My app i have a search option for stores. I can do the search with two criteria: By Name and By Distance. The user can choose only one of them. The required "shape" is
The required RadioButtons marked by the red "circle". How it can be done? Thanks, Eyal.
Upvotes: 0
Views: 99
Reputation: 2483
Use ToggleButtons
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Toggle"
android:id="@+id/toggleButton"/>
Upvotes: 0
Reputation: 447
You can change your radiobutton in xml to something like this
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/customradiobutton"
android:button="@android:color/transparent"
android:checked="true"
android:text="RadioButton1" />
And for customradiobutton you can add
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/checked_image"
android:state_checked="true" />
<item
android:drawable="@drawable/unchecked_image" />
Another better idea would to use ToggleButton instead of RadioButtons
Upvotes: 1