前言html
本章翻譯的是android.widget.RadioButton,譯爲單選按鈕,一般狀況下與RadioGroup一塊兒使用,示例參見這裏。歡迎更多朋友一塊兒參與Android API 的中文翻譯行動!個人郵箱over140@gmail.com。
java
聲明android
歡迎轉載,但請保留文章原始出處:)
ide
農民伯伯:http://over140.blog.51cto.com/ui
正文spa
1、結構.net
public class RadioButton extends CompoundButton
java.lang.Object
android.view.View
android.widget.TextView
android.widget.Button
android.widget.CompoundButton
android.widget.RadioButton
翻譯
2、概述
htm
單選按鈕是一種雙狀態的按鈕,能夠選擇或不選中。在單選按鈕沒有被選中時,用戶可以按下或點擊來選中它。可是,與複選框相反,用戶一旦選中就不可以取消選中(譯者注:能夠經過代碼來控制,界面上點擊的效果是一旦選中以後就不能取消選中了)。 blog
多個單選按鈕一般與RadioGroup同時使用。當一個單選組(RadioGroup)包含幾個單選按鈕時,選中其中一個的同時將取消其它選中的單選按鈕。(譯者注:示例參見這裏)
3、公共方法
public void toggle ()
將單選按鈕更改成與當前選中狀態相反的狀態。
若是這個單選按鈕已經選中,這個方法將不切換單選按鈕。(譯者注:請看源碼:
4、下載
PDF下載:http://download.csdn.net/source/2735947
5、系列
Android2.2 API 中文文檔系列(1) —— TextView
Android2.2 API 中文文檔系列(2) —— EditText
Android2.2 API 中文文檔系列(3) —— AccessibilityService
Android2.2 API 中文文檔系列(4) —— Manifest
Android2.2 API 中文文檔系列(5) —— View
Android2.2 API 中文文檔系列(6) —— ImageView
Android2.2 API 中文文檔系列(7) —— ImageButton
Android2.2 API 中文文檔系列(8) —— QuickContactBadge