简体   繁体   中英

Radio button group in MobileFirst Android

I want to put two radio buttons (male and female) in my application.

I did so using radio buttons (not group) but the problem is: a button can not be unchecked also both can be checked at the same time

RadioButton group is a group of three buttons and I only need two. Is there a way they can be two?

So any help?

Try this:

<RadioGroup
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Male"/>
        <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Female"/>
        </RadioGroup>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM