04 RadioGroup

你的名字 2022-03-19 02:40 304阅读 0赞
  1. 1. RadioGroupRadioButton
  2. HTML中,<input type="radio">
  3. java.lang.Object
  4. |-android.view.View
  5. |-android.view.ViewGroup
  6. |-android.widget.LinearLayout
  7. |-android.widget.RadioGroup
  8. 2. RadioGroup 单选钮在开发中提供了 一种多选一的操作模式。
  9. LinearLayout属于布局管理器,所以对于单选按钮而言肯定也要采用一定的布局管理。
  10. 3. 对于很多语言的单选钮直接定义即可,但是在android中,RadioGroup定义的只是一个
  11. 单选钮的容器,在这个容器中以后要加入多个单选项,而这个单选项就是RadioButton
  12. 4. RadioButton
  13. java.lang.Object
  14. |-android.view.View
  15. |-android.widget.TextView
  16. |-android.widget.Button
  17. |-android.widget.CompoundButton
  18. |-android.widget.RadioButton
  19. <RadioGroup
  20. android:layout_width="fill_parent"
  21. android:layout_height="wrap_content"
  22. android:orientation="vertical"
  23. android:checkedButton="@+id/male1">
  24. <RadioButton
  25. android:id="@+id/male1"
  26. android:text="@string/namemale"/>
  27. <RadioButton
  28. android:id="@+id/female1"
  29. android:text="@string/namefemale"/>
  30. </RadioGroup>

发表评论

表情:
评论列表 (有 0 条评论,304人围观)

还没有评论,来说两句吧...

相关阅读