完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/ToggleButton.html
ToggleButton
public class ToggleButton
extends CompoundButton
java.lang.Object | |||||
↳ | android.view.View | ||||
↳ | android.widget.TextView | ||||
↳ | android.widget.Button | ||||
↳ | android.widget.CompoundButton | ||||
↳ | android.widget.ToggleButton |
Displays checked/unchecked states as a button with a "light" indicator and by default accompanied with the text "ON" or "OFF".
带“光亮”指示器的按钮,其显示选中/未选中状态,并且默认情况下,还在按钮上显示“ON”或“OFF”文本。
See the Toggle Buttons guide.
请参考Toggle Buttons。
摘要
XML属性 | |
---|---|
android:disabledAlpha | 当被禁用时,此alpha值将应用于指示器。 |
android:textOff | 当没有被选中时,按钮的文本。 |
android:textOn | 当被选中时,按钮的文本。 |
继承XML属性 | |
---|---|
![]() android.widget.CompoundButton
| |
![]() android.widget.TextView
| |
![]() android.view.View
|
继承常量 |
---|
![]() android.widget.TextView
|
![]() android.view.View
|
继承字段 |
---|
![]() android.view.View
|
Public构造方法 | |
---|---|
ToggleButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) | |
ToggleButton(Context context, AttributeSet attrs, int defStyleAttr) | |
ToggleButton(Context context, AttributeSet attrs) | |
ToggleButton(Context context) |
Public方法 | |
---|---|
CharSequence | getAccessibilityClassName() Return the class name of this object to be used for accessibility purposes. |
CharSequence | getTextOff() Returns the text for when the button is not in the checked state. |
CharSequence | getTextOn() Returns the text for when the button is in the checked state. |
void | setBackgroundDrawable(Drawable d) This method is deprecated. use |
void | setChecked(boolean checked) Changes the checked state of this button. |
void | setTextOff(CharSequence textOff) Sets the text for when the button is not in the checked state. |
void | setTextOn(CharSequence textOn) Sets the text for when the button is in the checked state. |
保护方法 | |
---|---|
void | drawableStateChanged() This function is called whenever the state of the view changes in such a way that it impacts the state of drawables being shown. |
void | onFinishInflate() Finalize inflating a view from XML. |
继承方法
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/ToggleButton.html