Share via


Drawable.Mutate Method

Definition

Make this drawable mutable.

[Android.Runtime.Register("mutate", "()Landroid/graphics/drawable/Drawable;", "GetMutateHandler")]
public virtual Android.Graphics.Drawables.Drawable Mutate ();
[<Android.Runtime.Register("mutate", "()Landroid/graphics/drawable/Drawable;", "GetMutateHandler")>]
abstract member Mutate : unit -> Android.Graphics.Drawables.Drawable
override this.Mutate : unit -> Android.Graphics.Drawables.Drawable

Returns

This drawable.

Attributes

Remarks

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.

Java documentation for android.graphics.drawable.Drawable.mutate().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also