Android7.0中文API -- RadioGroup

来源:互联网 发布:淘宝手机详情图片大小 编辑:程序博客网 时间:2024/06/05 17:29

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/RadioGroup.html


RadioGroup

public class RadioGroup
extendsLinearLayout

java.lang.Object   ↳android.view.View    ↳android.view.ViewGroup     ↳android.widget.LinearLayout      ↳android.widget.RadioGroup

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.
这个类用于创建容纳一组单选按钮的容器,用户只能选中其中的一项。选择属于一个RadioGroup的一个单选按钮,并取消选择同一组中前面已选择的单选按钮。

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.
最初,所有的单选按钮都是未被选择的。虽然不可能取消选择一个特定的单选按钮,但是可以清除RadioGroup来删除已选择的状态。

The selection is identified by the unique id of the radio button as defined in the XML layout file.
选择是通过在XML布局文件中定义的单选按钮的惟一id来标识的。

XML Attributes
XML属性

See RadioGroup Attributes,LinearLayout Attributes,ViewGroup Attributes,View Attributes
请参考RadioGroup AttributesLinearLayout AttributesViewGroup AttributesView Attributes

Also see LinearLayout.LayoutParams for layout attributes.
参考LinearLayout.LayoutParams了解布局属性。

See also:
另请参考:

  • RadioButton

摘要


嵌套类

classRadioGroup.LayoutParams

This set of layout parameters defaults the width and the height of the children toWRAP_CONTENT when they are not specified in the XML file. 
这组布局参数默认设置子项的宽度和高度为WRAP_CONTENT,当这些属性没有在XML文件中指定。 

interfaceRadioGroup.OnCheckedChangeListener

Interface definition for a callback to be invoked when the checked radio button changed in this group. 
此接口定义了一个回调,当此组中的单选按钮的选择状态发生改变时调用。 

XML属性

android:checkedButton单选按钮的ID,其默认在单选按钮组中被选中。 

继承XML属性

From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View

继承常量

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/RadioGroup.html