Android 2.2 r1 API 中文文档系列(11) —— RadioButton
一、結(jié)構(gòu)
public class RadioButton extends CompoundButton
java.lang.Object
?? android.view.View
? ?? ??? android.widget.TextView
? ?? ? ??? ??? android.widget.Button
? ?? ? ??? ? ??? ??? android.widget.CompoundButton
? ?? ? ??? ? ??? ? ??? ??? android.widget.RadioButton
二、概述
單選按鈕是一種雙狀態(tài)的按鈕,可以選擇或不選中。在單選按鈕沒(méi)有被選中時(shí),用戶(hù)能夠按下或點(diǎn)擊來(lái)選中它。但是,與復(fù)選框相反,用戶(hù)一旦選中就不能夠取消選中(譯者注:可以通過(guò)代碼來(lái)控制,界面上點(diǎn)擊的效果是一旦選中之后就不能取消選中了)。?????????
多個(gè)單選按鈕通常與RadioGroup同時(shí)使用。當(dāng)一個(gè)單選組(RadioGroup)包含幾個(gè)單選按鈕時(shí),選中其中一個(gè)的同時(shí)將取消其它選中的單選按鈕。(譯者注:示例參見(jiàn)這里)
三、公共方法?
?????????public void toggle ()
?????????將單選按鈕更改為與當(dāng)前選中狀態(tài)相反的狀態(tài)。
?????????如果這個(gè)單選按鈕已經(jīng)選中,這個(gè)方法將不切換單選按鈕。(譯者注:請(qǐng)看源碼:?
?????????
四、下載
PDF下載:http://download.csdn.net/source/2735947
五、系列
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) —— QuickContactBadgeAndroid2.2 API 中文文檔系列(9) —— ZoomButton
Android2.2 r1 API 中文文檔系列(10) —— CheckBox
本文轉(zhuǎn)自博客園農(nóng)民伯伯的博客,原文鏈接:Android 2.2 r1 API 中文文檔系列(11) —— RadioButton,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原博主。
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專(zhuān)家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的Android 2.2 r1 API 中文文档系列(11) —— RadioButton的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 代码生成工具Database2Sharp
- 下一篇: android sina oauth2.