Resources.ObtainAttributes(IAttributeSet, Int32[]) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從屬性集取得一組基本屬性值,而非使用主題和/或樣式資源來進行樣式調整。
[Android.Runtime.Register("obtainAttributes", "(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;", "GetObtainAttributes_Landroid_util_AttributeSet_arrayIHandler")]
public virtual Android.Content.Res.TypedArray? ObtainAttributes(Android.Util.IAttributeSet? set, int[]? attrs);
[<Android.Runtime.Register("obtainAttributes", "(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;", "GetObtainAttributes_Landroid_util_AttributeSet_arrayIHandler")>]
abstract member ObtainAttributes : Android.Util.IAttributeSet * int[] -> Android.Content.Res.TypedArray
override this.ObtainAttributes : Android.Util.IAttributeSet * int[] -> Android.Content.Res.TypedArray
參數
- set
- IAttributeSet
目前要取回的屬性值。
- attrs
- Int32[]
要取得的特定屬性。 這些屬性 ID 必須依升序排序。
傳回
回傳一個 TypedArray,裡面包含屬性值的陣列。
完成後一定要打電話 TypedArray#recycle() TypedArray.recycle() 給我。
- 屬性
備註
從屬性集取得一組基本屬性值,而非使用主題和/或樣式資源來進行樣式調整。
Java 文件 android.content.res.Resources.obtainAttributes(android.util.AttributeSet, int[])。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。