RadioGroup:
| java.lang.Object | ||||
| ↳ | android.view.View | |||
| ↳ | android.view.ViewGroup | |||
| ↳ | android.widget.LinearLayout | |||
| ↳ | android.widget.RadioGroup | |||
RadioButton:
| java.lang.Object | |||||
| ↳ | android.view.View | ||||
| ↳ | android.widget.TextView | ||||
| ↳ | android.widget.Button | ||||
| ↳ | android.widget.CompoundButton | ||||
| ↳ | android.widget.RadioButton | ||||
原意:
A radio button is a two-states button that can be either checked or unchecked. When the radio button is unchecked, the user can press or click it to check it.
译文:
单选按钮是两种状态的按钮,可以是选中或不选中状态。当单选按钮未被选中,用户可以按下或点击它来选中它。
CheckBox:
| java.lang.Object | |||||
| ↳ | android.view.View | ||||
| ↳ | android.widget.TextView | ||||
| ↳ | android.widget.Button | ||||
| ↳ | android.widget.CompoundButton | ||||
| ↳ | android.widget.CheckBox | ||||
原意:
A checkbox is a specific type of two-states button that can be either checked or unchecked
译文:
一个checkbox是一个指定的两种状态类型的按钮,它要么被选中要么不被选中。
Toast:
| java.lang.Object | |
| ↳ | android.widget.Toast |
原意:
A toast is a view containing a quick little message for the user. The toast class helps you create and show those.
译文:
一个Toast是一个快速显示一小段信息给用户的视图。toast类可以帮组我们创建和显示这些信息。
代码示例:
演示效果:

原意:
This class is used to create a multiple-exclusion scope for a set of radio buttons. Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group.
Intially, all of the radio buttons are unchecked. While it is not possible to uncheck a particular radio button, the radio group can be cleared to remove the checked state.
译文:
这个类是用来创建具有相互排斥的一个可选择radio按钮。在同一组内,选择其中一个按钮就预示着要取消另一个按钮的选择。
最初,单选按钮都是未选中。如果一个radio组被移除和取消,是不可能去选择一个radio按钮的。
本文详细介绍了Android开发中常用的UI控件,包括RadioGroup、RadioButton、CheckBox和Toast等。通过实例代码展示了如何使用这些控件及其实现的效果。
3618

被折叠的 条评论
为什么被折叠?



