Udostępnij za pośrednictwem


Drawable.ConstantState.NewDrawable Method

Definition

Overloads

NewDrawable()

Creates a new Drawable instance from its constant state.

NewDrawable(Resources)

Creates a new Drawable instance from its constant state using the specified resources.

NewDrawable(Resources, Resources+Theme)

NewDrawable()

Creates a new Drawable instance from its constant state.

[Android.Runtime.Register("newDrawable", "()Landroid/graphics/drawable/Drawable;", "GetNewDrawableHandler")]
public abstract Android.Graphics.Drawables.Drawable NewDrawable ();
[<Android.Runtime.Register("newDrawable", "()Landroid/graphics/drawable/Drawable;", "GetNewDrawableHandler")>]
abstract member NewDrawable : unit -> Android.Graphics.Drawables.Drawable

Returns

a new drawable object based on this constant state

Attributes

Remarks

Creates a new Drawable instance from its constant state.

<strong>Note:</strong> Using this method means density-dependent properties, such as pixel dimensions or bitmap images, will not be updated to match the density of the target display. To ensure correct scaling, use #newDrawable(Resources) instead to provide an appropriate Resources object.

Java documentation for android.graphics.drawable.Drawable.ConstantState.newDrawable().

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

NewDrawable(Resources)

Creates a new Drawable instance from its constant state using the specified resources.

[Android.Runtime.Register("newDrawable", "(Landroid/content/res/Resources;)Landroid/graphics/drawable/Drawable;", "GetNewDrawable_Landroid_content_res_Resources_Handler")]
public virtual Android.Graphics.Drawables.Drawable NewDrawable (Android.Content.Res.Resources? res);
[<Android.Runtime.Register("newDrawable", "(Landroid/content/res/Resources;)Landroid/graphics/drawable/Drawable;", "GetNewDrawable_Landroid_content_res_Resources_Handler")>]
abstract member NewDrawable : Android.Content.Res.Resources -> Android.Graphics.Drawables.Drawable
override this.NewDrawable : Android.Content.Res.Resources -> Android.Graphics.Drawables.Drawable

Parameters

res
Resources

the resources of the context in which the drawable will be displayed

Returns

a new drawable object based on this constant state

Attributes

Remarks

Creates a new Drawable instance from its constant state using the specified resources. This method should be implemented for drawables that have density-dependent properties.

The default implementation for this method calls through to #newDrawable().

Java documentation for android.graphics.drawable.Drawable.ConstantState.newDrawable(android.content.res.Resources).

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

NewDrawable(Resources, Resources+Theme)

[Android.Runtime.Register("newDrawable", "(Landroid/content/res/Resources;Landroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;", "GetNewDrawable_Landroid_content_res_Resources_Landroid_content_res_Resources_Theme_Handler")]
public virtual Android.Graphics.Drawables.Drawable NewDrawable (Android.Content.Res.Resources? res, Android.Content.Res.Resources.Theme? theme);
[<Android.Runtime.Register("newDrawable", "(Landroid/content/res/Resources;Landroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;", "GetNewDrawable_Landroid_content_res_Resources_Landroid_content_res_Resources_Theme_Handler")>]
abstract member NewDrawable : Android.Content.Res.Resources * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable
override this.NewDrawable : Android.Content.Res.Resources * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable

Parameters

res
Resources

Returns

Attributes

Remarks

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