public final class CompoundButtonCompat
extends Object
java.lang.Object | |
↳ | android.support.v4.widget.CompoundButtonCompat |
Helper用于以向后兼容的方式访问API级别4之后引入的 CompoundButton
方法。
Public methods |
|
---|---|
static Drawable |
getButtonDrawable(CompoundButton button) 返回用作复合按钮图像的绘图 |
static ColorStateList |
getButtonTintList(CompoundButton button) 返回应用于可绘制按钮的色调 |
static PorterDuff.Mode |
getButtonTintMode(CompoundButton button) |
static void |
setButtonTintList(CompoundButton button, ColorStateList tint) 对可绘制按钮应用色调。 |
static void |
setButtonTintMode(CompoundButton button, PorterDuff.Mode tintMode) 指定用于将按钮 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
Drawable getButtonDrawable (CompoundButton button)
返回用作复合按钮图像的绘图
Parameters | |
---|---|
button |
CompoundButton
|
Returns | |
---|---|
Drawable |
也可以看看:
ColorStateList getButtonTintList (CompoundButton button)
返回应用于可绘制按钮的色调
Parameters | |
---|---|
button |
CompoundButton
|
Returns | |
---|---|
ColorStateList |
PorterDuff.Mode getButtonTintMode (CompoundButton button)
Parameters | |
---|---|
button |
CompoundButton
|
Returns | |
---|---|
PorterDuff.Mode |
the blending mode used to apply the tint to the button drawable |
void setButtonTintList (CompoundButton button, ColorStateList tint)
对可绘制按钮应用色调。 不会修改当前着色模式,默认为SRC_IN
。
随后调用 setButtonDrawable(Drawable)
应自动 setButtonDrawable(Drawable)
drawable,并使用 setTintList(Drawable, ColorStateList)
应用指定的色调和色调模式。
Parameters | |
---|---|
button |
CompoundButton
|
tint |
ColorStateList : the tint to apply, may be null to clear tint |
void setButtonTintMode (CompoundButton button, PorterDuff.Mode tintMode)
指定用于将按钮setButtonTintList(CompoundButton, ColorStateList)
}指定的色调应用于可绘制按钮的混合模式。 默认模式是SRC_IN
。
Parameters | |
---|---|
button |
CompoundButton
|
tintMode |
PorterDuff.Mode : the blending mode used to apply the tint, may be null to clear tint |