chy18883701161

 

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>

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-04-30
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-26
  • 2021-04-26
  • 2022-12-23
  • 2021-10-09
相关资源
相似解决方案