public interface TintableBackgroundView
| android.support.v4.view.TintableBackgroundView |
| |
当在API v20设备或更低版本上运行时,允许 View从 ViewCompat接收背景调色呼叫的接口。
公共方法(Public methods) |
|
|---|---|
abstract ColorStateList |
getSupportBackgroundTintList() 如果指定,返回应用于背景可绘制的色调。 |
abstract PorterDuff.Mode |
getSupportBackgroundTintMode() 如果指定,则返回用于将色调应用于背景可绘制的混合模式。 |
abstract void |
setSupportBackgroundTintList(ColorStateList tint) 将背景色应用于背景。 |
abstract void |
setSupportBackgroundTintMode(PorterDuff.Mode tintMode) 指定用于将背景可绘制的颜色应用于 |
ColorStateList getSupportBackgroundTintList ()
如果指定,返回应用于背景可绘制的色调。
| 返回(Returns) | |
|---|---|
ColorStateList |
the tint applied to the background drawable |
PorterDuff.Mode getSupportBackgroundTintMode ()
如果指定,则返回用于将色调应用于背景可绘制的混合模式。
| 返回(Returns) | |
|---|---|
PorterDuff.Mode |
the blending mode used to apply the tint to the background drawable |
void setSupportBackgroundTintList (ColorStateList tint)
将背景色应用于背景。 不会修改当前着色模式,默认为SRC_IN 。
随后对 View.setBackground(Drawable)调用将自动改变drawable并应用指定的着色和着色模式。
| 参数(Parameters) | |
|---|---|
tint |
ColorStateList: the tint to apply, may be null to clear tint |
void setSupportBackgroundTintMode (PorterDuff.Mode tintMode)
指定用于将setSupportBackgroundTintList(ColorStateList) }指定的色调应用于背景可绘制的混合模式。 默认模式是SRC_IN 。
| 参数(Parameters) | |
|---|---|
tintMode |
PorterDuff.Mode: the blending mode used to apply the tint, may be null to clear tint |