# 关于 Android 背景色 Alpha 值的一个坑

// 滚动监听器 伪代码
someParams -> {
//...
view.getBackground().setAlpha(percent);
//...
}


UPDATE：

Drawable mutate ()

Make this drawable mutable. This operation cannot be reversed. A mutable drawable is guaranteed to not share its state with any other drawable. This is especially useful when you need to modify properties of drawables loaded from resources. By default, all drawables instances loaded from the same resource share a common state; if you modify the state of one instance, all the other instances will receive the same modification. Calling this method on a mutable Drawable will have no effect.

Drawable mutate ()