大家好,又见面了,我是你们的朋友全栈君。
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/CompoundButton.html
CompoundButton
public abstract class CompoundButton
extends Button
implements Checkable
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.widget.TextView | |||
↳ | android.widget.Button | |||
↳ | android.widget.CompoundButton |
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属性 |
|
---|---|
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构造方法 |
|
---|---|
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 |
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. |
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 |
AutoFillValue |
getAutoFillValue()
Gets the |
Drawable |
getButtonDrawable() |
ColorStateList |
getButtonTintList() |
PorterDuff.Mode |
getButtonTintMode() |
int |
getCompoundPaddingLeft()
Returns the left padding of the view, plus space for the left Drawable if any. |
int |
getCompoundPaddingRight()
Returns the right padding of the view, plus space for the right Drawable if any. |
boolean |
isChecked() |
void |
jumpDrawablesToCurrentState()
Call |
void |
onRestoreInstanceState(Parcelable state)
Hook allowing a view to re-apply a representation of its internal state that had previously been generated by |
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. |
void |
setButtonDrawable(int resId)
Sets a drawable as the compound button image given its resource identifier. |
void |
setButtonDrawable(Drawable drawable)
Sets a drawable as the compound button image. |
void |
setButtonTintList(ColorStateList tint)
Applies a tint to the button drawable. |
void |
setButtonTintMode(PorterDuff.Mode tintMode)
Specifies the blending mode used to apply the tint specified by |
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
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/142779.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...