Preface
This chapter translates Android. widget. radiobutton into a single-choice button, which is usually used with radiogroup. For example, see here. More friends are welcome to join the Chinese translation operation of Android Api! My mailbox over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog: http://www.cnblogs.com
Farmer's uncle: http://www.cnblogs.com/over140/
Body
I. Structure
Public class radiobutton extends compoundbutton
Java. Lang. Object
Android. View. View
Android. widget. textview
Android. widget. Button
Android. widget. compoundbutton
Android. widget. radiobutton
Ii. Overview
A single-choice button is a double-state button that can be selected or not selected. When a single-choice button is not selected, you can press or click it to select it. However, in contrast to the check box, the user cannot unselect the check box once selected. (Note: You can use the code to control the check box. The effect of clicking on the interface is that the check box cannot be unselected once selected ).
Multiple radio buttons are usually used together with radiogroup. When a single-choice group contains multiple single-choice buttons, selecting one of them will cancel other selected single-choice buttons. (For example, see here)
Iii. Public Methods
Public void toggle ()
Change the single-choice button to the opposite of the selected one.
If this single-choice button is selected, this method will not switch the single-choice button. (Translator's note: Please refer to the source code:
4. Download
Download: http://download.csdn.net/source/2735947
V. Series
Android2.2 API Chinese Document Series (1) -- textview
Android2.2 API Chinese Document Series (2) -- edittext
Android2.2 API Chinese Document Series (3) -- accessibilityservice
Android2.2 API Chinese Document Series (4) -- manifest
Android2.2 API Chinese Document Series (5) -- View
Android2.2 API Chinese Document Series (6) -- imageview
Android2.2 API Chinese Document Series (7) -- imagebutton
Android2.2 API Chinese Document Series (8) -- quickcontactbadge
Android2.2 API Chinese Document Series (9) -- zoombutton
Android2.2 R1 API Chinese Document Series (10) -- checkbox