语言

Resources.ObtainTypedArray(Int32) 方法

定义

返回异类值的数组。

[Android.Runtime.Register("obtainTypedArray", "(I)Landroid/content/res/TypedArray;", "GetObtainTypedArray_IHandler")]
public virtual Android.Content.Res.TypedArray ObtainTypedArray(int id);
[<Android.Runtime.Register("obtainTypedArray", "(I)Landroid/content/res/TypedArray;", "GetObtainTypedArray_IHandler")>]
abstract member ObtainTypedArray : int -> Android.Content.Res.TypedArray
override this.ObtainTypedArray : int -> Android.Content.Res.TypedArray

参数

id
Int32

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

返回

返回一个 TypedArray,其中包含数组值的数组。 请务必在完成时调用 TypedArray#recycle() TypedArray.recycle() 。

特性

例外

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

注解

返回异类值的数组。

Java文档android.content.res.Resources.obtainTypedArray(int)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于