Share via


StateListDrawable.AddState(Int32[], Drawable) Method

Definition

Add a new image/string ID to the set of images.

[Android.Runtime.Register("addState", "([ILandroid/graphics/drawable/Drawable;)V", "GetAddState_arrayILandroid_graphics_drawable_Drawable_Handler")]
public virtual void AddState (int[]? stateSet, Android.Graphics.Drawables.Drawable? drawable);
[<Android.Runtime.Register("addState", "([ILandroid/graphics/drawable/Drawable;)V", "GetAddState_arrayILandroid_graphics_drawable_Drawable_Handler")>]
abstract member AddState : int[] * Android.Graphics.Drawables.Drawable -> unit
override this.AddState : int[] * Android.Graphics.Drawables.Drawable -> unit

Parameters

stateSet
Int32[]

An array of resource Ids to associate with the image. Switch to this image by calling setState().

drawable
Drawable

The image to show. Note this must be a unique Drawable that is not shared between any other View or Drawable otherwise the results are undefined and can lead to unexpected rendering behavior

Attributes

Remarks

Add a new image/string ID to the set of images.

Java documentation for android.graphics.drawable.StateListDrawable.addState(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