转载请注明出处:http://blog.csdn.net/crazy1235/article/details/75670018
http://www.jb51.net/article/110035.htm
/**
* 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.
*
* @return This drawable.
* @see ConstantState
* @see #getConstantState()
*/
public @NonNull Drawable mutate() {
return this;
}

本文介绍如何通过调用Drawable的mutate()方法确保Drawable实例的状态独立于资源加载过程中的其他实例。这样可以避免修改一个实例时影响到其他实例的状态。
2070

被折叠的 条评论
为什么被折叠?



