Resources.GetColorStateList Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetColorStateList(Int32) |
Returns a color state list associated with a particular resource ID. |
GetColorStateList(Int32, Resources+Theme) |
Returns a color state list associated with a particular resource ID. |
GetColorStateList(Int32)
Returns a color state list associated with a particular resource ID.
[Android.Runtime.Register("getColorStateList", "(I)Landroid/content/res/ColorStateList;", "GetGetColorStateList_IHandler")]
public virtual Android.Content.Res.ColorStateList GetColorStateList (int id);
[<Android.Runtime.Register("getColorStateList", "(I)Landroid/content/res/ColorStateList;", "GetGetColorStateList_IHandler")>]
abstract member GetColorStateList : int -> Android.Content.Res.ColorStateList
override this.GetColorStateList : int -> Android.Content.Res.ColorStateList
Parameters
- id
- Int32
The desired resource identifier of a ColorStateList
,
as generated by the aapt tool. This integer encodes the
package, type, and resource entry. The value 0 is an invalid
identifier.
Returns
A ColorStateList object containing either a single solid color or multiple colors that can be selected based on a state.
- Attributes
Exceptions
Throws NotFoundException if the given ID does not exist.
Remarks
Returns a color state list associated with a particular resource ID. The resource may contain either a single raw color value or a complex ColorStateList
holding multiple possible colors.
This member is deprecated. Use #getColorStateList(int, Theme)
instead.
Java documentation for android.content.res.Resources.getColorStateList(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
GetColorStateList(Int32, Resources+Theme)
Returns a color state list associated with a particular resource ID.
[Android.Runtime.Register("getColorStateList", "(ILandroid/content/res/Resources$Theme;)Landroid/content/res/ColorStateList;", "GetGetColorStateList_ILandroid_content_res_Resources_Theme_Handler", ApiSince=23)]
public virtual Android.Content.Res.ColorStateList GetColorStateList (int id, Android.Content.Res.Resources.Theme? theme);
[<Android.Runtime.Register("getColorStateList", "(ILandroid/content/res/Resources$Theme;)Landroid/content/res/ColorStateList;", "GetGetColorStateList_ILandroid_content_res_Resources_Theme_Handler", ApiSince=23)>]
abstract member GetColorStateList : int * Android.Content.Res.Resources.Theme -> Android.Content.Res.ColorStateList
override this.GetColorStateList : int * Android.Content.Res.Resources.Theme -> Android.Content.Res.ColorStateList
Parameters
- id
- Int32
The desired resource identifier of a ColorStateList
,
as generated by the aapt tool. This integer encodes the
package, type, and resource entry. The value 0 is an invalid
identifier.
- theme
- Resources.Theme
Returns
A ColorStateList object containing either a single solid color or multiple colors that can be selected based on a state.
- Attributes
Remarks
Java documentation for android.content.res.Resources.getColorStateList(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.