Most visited

Recently visited

CompoundButtonCompat

public final class CompoundButtonCompat
extends Object

java.lang.Object
   ↳ android.support.v4.widget.CompoundButtonCompat


Helper用于以向后兼容的方式访问API级别4之后引入的 CompoundButton方法。

Summary

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)

指定用于将按钮 setButtonTintList(CompoundButton, ColorStateList) }指定的色调应用于可绘制按钮的混合模式。

Inherited methods

From class java.lang.Object

Public methods

getButtonDrawable

Drawable getButtonDrawable (CompoundButton button)

返回用作复合按钮图像的绘图

Parameters
button CompoundButton
Returns
Drawable

也可以看看:

getButtonTintList

ColorStateList getButtonTintList (CompoundButton button)

返回应用于可绘制按钮的色调

Parameters
button CompoundButton
Returns
ColorStateList

也可以看看:

getButtonTintMode

PorterDuff.Mode getButtonTintMode (CompoundButton button)

Parameters
button CompoundButton
Returns
PorterDuff.Mode the blending mode used to apply the tint to the button drawable

也可以看看:

setButtonTintList

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

也可以看看:

setButtonTintMode

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

也可以看看:

Hooray!