Custom View in android/
I need to make a custom view as shown in diagram, which needs to functional like radio button, any of th开发者_如何学Ce options needs to be selected. How can I achieve this? I don`t want to use series of buttons.
You can use RadioGroup and RadioButtons to achieve this. For example,
<RadioButton
android:id="@+id/custom_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:button="@null"
android:background="@drawable/button_custom"/>
Where button_custom is the background image of the button shown. This image should have all the variations (like, normal, pressed, enabled, disabled, selected).
精彩评论