ColorStateList.GetColorForState(Int32[], Color) Method

Definition

Return the color associated with the given set of android.view.View states.

[Android.Runtime.Register("getColorForState", "([II)I", "GetGetColorForState_arrayIIHandler")]
public virtual int GetColorForState (int[]? stateSet, Android.Graphics.Color defaultColor);
[<Android.Runtime.Register("getColorForState", "([II)I", "GetGetColorForState_arrayIIHandler")>]
abstract member GetColorForState : int[] * Android.Graphics.Color -> int
override this.GetColorForState : int[] * Android.Graphics.Color -> int

Parameters

stateSet
Int32[]

an array of android.view.View states

defaultColor
Color

the color to return if there's no matching state spec in this ColorStateList that matches the stateSet.

Returns

the color associated with that set of states in this ColorStateList.

Attributes

Remarks

Return the color associated with the given set of android.view.View states.

Java documentation for android.content.res.ColorStateList.getColorForState(int[], int).

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