第八节--控件(一)RadioGroup,RadioButton,CheckBox,Toast

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按钮的。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值