Resources.GetColorStateList 方法

定义

重载

GetColorStateList(Int32)

返回与特定资源 ID 关联的颜色状态列表。

GetColorStateList(Int32, Resources+Theme)

返回与特定资源 ID 关联的颜色状态列表。

GetColorStateList(Int32)

返回与特定资源 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

参数

id
Int32

aapt 工具生成的所需资源标识符 ColorStateList。 此整数对包、类型和资源条目进行编码。 值 0 是无效的标识符。

返回

一个 ColorStateList 对象,该对象包含单个纯色或多个可根据状态选择的颜色。

属性

例外

如果给定 ID 不存在,则引发 NotFoundException。

注解

返回与特定资源 ID 关联的颜色状态列表。 资源可能包含单个原始颜色值或包含多个可能颜色的复 ColorStateList 数。

此成员已弃用。 请改用 #getColorStateList(int, Theme)

适用于 . 的 android.content.res.Resources.getColorStateList(int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

GetColorStateList(Int32, Resources+Theme)

返回与特定资源 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

参数

id
Int32

aapt 工具生成的所需资源标识符 ColorStateList。 此整数对包、类型和资源条目进行编码。 值 0 是无效的标识符。

返回

一个 ColorStateList 对象,该对象包含单个纯色或多个可根据状态选择的颜色。

属性

注解

适用于 . 的 android.content.res.Resources.getColorStateList(int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于