1.RadioButton

RadioButton被称作为单选框,通常都是以组的形式出现,可以在一组控件中选择一个。

RadioButton的使用首先需要加入<RadioGroup/>,在这个组中,我们进行单选按钮的声明。

 1   <RadioGroup
 2         android:id="@+id/radioGroup"
 3         android:layout_width="wrap_content"
 4         android:layout_height="wrap_content"
 5         android:layout_x="51dp"
 6         android:layout_y="182dp" >
 7 
 8         <RadioButton
 9             android:id="@+id/radioButton2"
10             android:layout_width="wrap_content"
11             android:layout_height="wrap_content"
12             android:layout_x="172dp"
13             android:layout_y="181dp"
14             android:text="关灯" />
15 
16         <RadioButton
17             android:id="@+id/radioButton1"
18             android:layout_width="wrap_content"
19             android:layout_height="wrap_content"
20             android:layout_x="36dp"
21             android:layout_y="201dp"
22             android:text="开灯" />
23     </RadioGroup>
RadioButton

相关文章:

  • 2021-11-10
  • 2021-09-30
  • 2021-05-28
  • 2021-10-28
  • 2021-06-08
  • 2022-02-19
  • 2021-11-15
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2022-12-23
  • 2021-09-21
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案