Android 2.2 r1 API 中文文檔系列(11) —— RadioButton

來源:互聯網
上載者:User

前言

  本章翻譯的是android.widget.RadioButton,譯為選項按鈕,通常情況下與RadioGroup一起使用,樣本參見這裡。歡迎更多朋友一起參與Android API 的中文翻譯行動!我的郵箱over140@gmail.com。

 

聲明

  歡迎轉載,但請保留文章原始出處:)

    部落格園:http://www.cnblogs.com

    農民伯伯: http://www.cnblogs.com/over140/

 

本文

  一、結構

    public class RadioButton extends CompoundButton

    java.lang.Object
        android.view.View
              android.widget.TextView
                    android.widget.Button
                           android.widget.CompoundButton
                                android.widget.RadioButton

  二、概述

    

    選項按鈕是一種雙狀態的按鈕,可以選擇或不選中。在選項按鈕沒有被選中時,使用者能夠按下或點擊來選中它。但是,與複選框相反,使用者一旦選中就不能夠取消選中(譯者註:可以通過代碼來控制,介面上點擊的效果是一旦選中之後就不能取消選中了)。         

    多個選項按鈕通常與RadioGroup同時使用。當一個單選組(RadioGroup)包含幾個選項按鈕時,選中其中一個的同時將取消其它選中的選項按鈕。(譯者註:樣本參見這裡)

 

  三、公用方法

         public void toggle ()

         將選項按鈕更改為與當前選中狀態相反的狀態。

         如果這個選項按鈕已經選中,這個方法將不切換選項按鈕。(譯者註:請看源碼:

 

        

 

  四、下載

    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) —— QuickContactBadge

    Android2.2 API 中文文檔系列(9) —— ZoomButton

    Android2.2 r1 API 中文文檔系列(10) —— CheckBox

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.