Android7.0中文文档(API) --- ToggleButton
2017-06-12 00:41
579 查看
完整内容,请查看: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 |
带“光亮”指示器的按钮,其显示选中/未选中状态,并且默认情况下,还在按钮上显示“ON”或“OFF”文本。
See the
Toggle Buttons guide.
请参考Toggle Buttons。
摘要
XML属性 | |
---|---|
android:disabledAlpha | 当被禁用时,此alpha值将应用于指示器。 |
android:textOff | 当没有被选中时,按钮的文本。 |
android:textOn | 当被选中时,按钮的文本。 |
继承XML属性 |
---|
![]() From class android.widget.CompoundButton |
![]() From class android.widget.TextView |
![]() From class android.view.View |
继承常量 |
---|
![]() From class android.widget.TextView |
![]() From class android.view.View |
继承字段 |
---|
![]() From class 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 setBackground(Drawable)instead 此方法已取消,使用 setBackground(Drawable)替代。 |
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. 每当视图状态发生变化时, 都会调用此方法, 从而影响所显示的drawable的状态。 |
void | onFinishInflate() Finalize inflating a view from XML. 完成从XML中加载(inflate)的视图。 |
继承方法
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/ToggleButton.html相关文章推荐
- Android7.0中文文档(API)--- DatePicker
- Android7.0中文文档(API)--- AbsoluteLayout
- Android7.0中文文档(API)-- TextSwitcher
- Android7.0中文文档(API)--- AutoCompleteTextView
- Android7.0中文文档(API)--- ViewSwitcher
- Android7.0中文文档(API) --- MediaController
- Android7.0中文文档(API)---Chronometer
- Android7.0中文文档(API)-- StackView
- Android7.0中文文档(API)--- AdapterViewAnimator
- Android7.0中文文档(API)--- ExpandableListView
- Android7.0中文文档(API) -- TimePicker
- Android7.0中文文档(API)-- DigitalClock
- Android7.0中文文档(API) --- RadioButton
- Android7.0中文文档(API)--- VideoView
- Android7.0中文文档(API)--- FrameLayout
- Android7.0中文文档(API)-- ViewAnimator
- Android7.0中文文档(API) -- ScrollView
- Android7.0中文文档(API) --- Button
- Android7.0中文文档 (API)--- QuickContactBadge
- Android7.0中文文档(API)--- ViewFlipper