AndroidRadioButton控件

    科技2022-08-01  124

     

    RadioButton   单选按钮  

     

    常用属性:

    text  文本

    checked=“true”  默认选中

     

    一组互斥的单选按钮要放在RadioGroup中。RadioGroup常用属性:

    orientation  该组单选按钮的排列方向。

     

    示例:

    <RadioGroup android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/gender" android:orientation="horizontal"> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/male" android:text="男"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/female" android:text="女"/> </RadioGroup>

     

    Processed: 0.009, SQL: 8