开发者

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.

Custom View in android/


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜