Android7.0中文文档 --- CompoundButton
来源:互联网 发布:jre windows x64 编辑:程序博客网 时间:2024/05/16 00:55
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/CompoundButton.html
CompoundButton
public abstract class CompoundButton
extendsButton
implements Checkable
A button with two states, checked and unchecked. When the button is pressed or clicked, the state changes automatically.
拥有选中和未选中这2种状态的按钮。当按钮被按下或点击,状态自动改变。
XML attributes
XML属性
See CompoundButton Attributes
,Button Attributes
,TextView Attributes
,View Attributes
请参考CompoundButton Attributes
,Button Attributes
,TextView Attributes
。View Attributes
摘要
嵌套类
interface
CompoundButton.OnCheckedChangeListener
Interface definition for a callback to be invoked when the checked state of a compound button changed.
回调方法的接口定义,当复合按钮的选择状态发生改变时调用。
XML属性
android:button
drawble,用于图像按钮。 android:buttonTint
用与按钮图像的tint。 android:buttonTintMode
混合模式,用于按钮图像着色。 继承XML属性
android.widget.TextView
android.view.View
继承常量
android.widget.TextView
android.view.View
继承字段
android.view.View
Public构造方法
CompoundButton(Context context)
CompoundButton(Context context, AttributeSet attrs)
CompoundButton(Context context, AttributeSet attrs, int defStyleAttr)
CompoundButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public方法
void
autoFill(AutoFillValue value)
Automatically fills the content of this view with the value
. value
用于自动填充此视图的内容。
void
drawableHotspotChanged(float x, float y)
This function is called whenever the view hotspot changes and needs to be propagated to drawables or child views managed by the view.
每当视图热点发生改变时,调用此方法,并需要传播到由视图管理的drawable或子视图。
CharSequence
getAccessibilityClassName()
Return the class name of this object to be used for accessibility purposes.
返回此对象的类名,用于辅助功能目的。
AutoFillType
getAutoFillType()
Describes the auto-fill type that should be used on calls to autoFill(AutoFillValue)
andautoFillVirtual(int, AutoFillValue)
.
描述应用于autoFill(AutoFillValue)
和autoFillVirtual(int, AutoFillValue)
调用的自动填充(auto-fill)类型。
AutoFillValue
getAutoFillValue()
Gets the View
's current auto-fill value.
获取View
的当前自动填充(auto-fill)值。
Drawable
getButtonDrawable()
ColorStateList
getButtonTintList()
PorterDuff.Mode
getButtonTintMode()
int
getCompoundPaddingLeft()
Returns the left padding of the view, plus space for the left Drawable if any.
返回视图左内边距(padding)的大小,如果有左边Drawable的话,则加上它的空间。
int
getCompoundPaddingRight()
Returns the right padding of the view, plus space for the right Drawable if any.
返回视图右内边距(padding)的大小,如果有右边Drawable的话,则加上它的空间。
boolean
isChecked()
void
jumpDrawablesToCurrentState()
Call Drawable.jumpToCurrentState()
on all Drawable objects associated with this view.
在与此视图关联的所有drawable对象上,调用Drawable.jumpToCurrentState()
。
void
onRestoreInstanceState(Parcelable state)
Hook allowing a view to re-apply a representation of its internal state that had previously been generated byonSaveInstanceState()
.
由应用程序实现,以有机会允许视图重新应用以前由onSaveInstanceState()
生成的内部状态。
Parcelable
onSaveInstanceState()
Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state.
由应用程序实现,以有机会允许视图生成其内部状态,稍后可用于创建具有相同状态的新实例。
boolean
performClick()
Call this view's OnClickListener, if it is defined.
调用此视图的OnClickListener(如果已经定义)。
void
setButtonDrawable(int resId)
Sets a drawable as the compound button image given its resource identifier.
使用指定的资源标识符,为复合按钮(CompoundButton)的图片设置一个drawable。
void
setButtonDrawable(Drawable drawable)
Sets a drawable as the compound button image.
为复合按钮(CompoundButton)图片设置一个drawable。
void
setButtonTintList(ColorStateList tint)
Applies a tint to the button drawable.
用于按钮drawable的tint。
void
setButtonTintMode(PorterDuff.Mode tintMode)
Specifies the blending mode used to apply the tint specified by setButtonTintList(ColorStateList)
} to the button drawable.
设置混合模式,用于由setButtonTintList(ColorStateList)
指定的按钮drawable的着色。
void
setChecked(boolean checked)
Changes the checked state of this button.
设置此按钮的选中状态。
void
setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener listener)
Register a callback to be invoked when the checked state of this button changes.
注册一个回调方法,当此按钮的选中状态发生改变时调用。
void
toggle()
Change the checked state of the view to the inverse of its current state
改变视图的选中状态,其与当前的状态相反。
保护方法
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/CompoundButton.html
- Android7.0中文文档 --- CompoundButton
- Android7.0中文文档 --- CheckBox
- Android7.0中文文档 -- AdapterViewFlipper
- Android7.0中文文档 --- EditText
- Android7.0中文文档 --- RelativeLayout
- Android7.0中文文档 -- Space
- Android7.0中文文档 -- GridLayout
- Android7.0中文文档(API) -- HorizontalScrollView
- Android7.0中文文档(API)--- FrameLayout
- Android7.0中文文档(API)--- CalendarView
- Android7.0中文文档(API)--- DatePicker
- Android7.0中文文档(API) --- MediaController
- Android7.0中文文档(API)--- TabHost
- Android7.0中文文档(API) -- TimePicker
- Android7.0中文文档(API)-- ViewAnimator
- Android7.0中文文档(API)--- AbsoluteLayout
- Android7.0中文文档(API) -- Switch
- Android7.0中文文档(API) --- ToggleButton
- 关于加密解密
- 网络留言簿
- 淘宝的购物车==> ”抛物线“
- 桌面精灵
- 浅入Https
- Android7.0中文文档 --- CompoundButton
- Spring中的AOP基础
- 短信发送
- git上传本地Intellij idea 项目到github
- 数据分页
- Google-Guice入门介绍
- 1、ES6 === let && const
- saltstack安装及基本命令
- openCV基础函数imread第二个参数