다음을 통해 공유


LayerDrawable.SetDrawableByLayerId(Int32, Drawable) Method

Definition

Replaces the Drawable for the layer with the given id.

[Android.Runtime.Register("setDrawableByLayerId", "(ILandroid/graphics/drawable/Drawable;)Z", "GetSetDrawableByLayerId_ILandroid_graphics_drawable_Drawable_Handler")]
public virtual bool SetDrawableByLayerId (int id, Android.Graphics.Drawables.Drawable? drawable);
[<Android.Runtime.Register("setDrawableByLayerId", "(ILandroid/graphics/drawable/Drawable;)Z", "GetSetDrawableByLayerId_ILandroid_graphics_drawable_Drawable_Handler")>]
abstract member SetDrawableByLayerId : int * Android.Graphics.Drawables.Drawable -> bool
override this.SetDrawableByLayerId : int * Android.Graphics.Drawables.Drawable -> bool

Parameters

id
Int32

The layer ID to search for.

drawable
Drawable

The replacement Drawable.

Returns

Whether the Drawable was replaced (could return false if the id was not found).

Attributes

Remarks

Replaces the Drawable for the layer with the given id.

Java documentation for android.graphics.drawable.LayerDrawable.setDrawableByLayerId(int, android.graphics.drawable.Drawable).

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