語言

TypedArray 類別

定義

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

[Android.Runtime.Register("android/content/res/TypedArray", DoNotGenerateAcw=true)]
public class TypedArray : Java.Lang.Object, IDisposable, Java.Lang.IAutoCloseable
[<Android.Runtime.Register("android/content/res/TypedArray", DoNotGenerateAcw=true)>]
type TypedArray = class
    inherit Object
    interface IAutoCloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
繼承
TypedArray
屬性
實作

備註

容器,用於取出的值陣列,這些值是用 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes取回的。 完成後務必打電話 #recycle 給他們。

用來從此結構取得值的索引對應於取得 StyledAttributes 所給出屬性的位置。

Java 文件 android.content.res.TypedArray

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

建構函式

名稱 Description
TypedArray(IntPtr, JniHandleOwnership)

用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。

屬性

名稱 Description
ChangingConfigurations

回傳一個配置參數的遮罩,該參數中此類型陣列的值可能會改變。

Class

回傳此 Object的執行時類別。

(繼承來源 Object)
Handle

底層 Android 實例的帳號。

(繼承來源 Object)
IndexCount

回傳陣列中實際有資料的索引數量。

JniIdentityHashCode

取得由互通執行時指派給此 Java 對等端的身份雜湊碼。

(繼承來源 Object)
JniManagedPeerState

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
JniPeerMembers

取得用於調用此 Java 節點成員的 JNI 元資料。

PeerReference

取得這個 Java 節點的 JNI 物件參考。

(繼承來源 Object)
PositionDescription

回傳一個關於解析器狀態的訊息,適合列印錯誤訊息。

Resources

回傳這個陣列所載入的 Resources 物件。

ThresholdClass

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

ThresholdType

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

方法

名稱 Description
Clone()

建立並回傳此物件的副本。

(繼承來源 Object)
Close()

回收 TypedArray,供後續呼叫者重複使用。

Construct(JniObjectReference, JniObjectReferenceOptions)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
Dispose()

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
Dispose(Boolean)

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
DisposeUnlessReferenced()

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
Equals(Object)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
Equals(Object)

表示是否有其他物體「等同」於此物。

(繼承來源 Object)
GetBoolean(Int32, Boolean)

在 var<index>/var< 處取得該屬性>的布林值。

GetColor(Int32, Int32)

在 var<index>/var< 處取得屬性>的顏色值。

GetColorStateList(Int32)

在 var<index>/var< 處取得該屬性>的 ColorStateList 。

GetDimension(Int32, Single)

在 var<index>/var< 處取得一個維度單位屬性>。

GetDimensionPixelOffset(Int32, Int32)

在 var<index>/var< 處取得一個維度單位屬性>,作為原始像素的偏移量。

GetDimensionPixelSize(Int32, Int32)

在 var<index>/var< 處取得一個維度單位屬性>,作為原始像素的尺寸。

GetDrawable(Int32)

在 var<index>/var< 處取得該屬性>的 Drawable。

GetFloat(Int32, Single)

在 var<index>/var< 處取得該屬性>的浮點數值。

GetFont(Int32)

在 var<index>/var< 處取得該屬性>的字體。

GetFraction(Int32, Int32, Int32, Single)

在 var index/var< 處擷取一個小數單位屬性>。<>

GetHashCode()

回傳物件的雜湊碼值。

(繼承來源 Object)
GetIndex(Int32)

回傳陣列中的索引,該索引包含資料。

GetInt(Int32, Int32)

在 var<index>/var< 處取得該屬性>的整數值。

GetInteger(Int32, Int32)

在 var<index>/var< 處取得該屬性>的整數值。

GetLayoutDimension(Int32, Int32)

用於取得 #getDimensionPixelSizelayout_width 和 layout_height屬性的特殊版本android.view.ViewGroup

GetLayoutDimension(Int32, String)

用於取得 #getDimensionPixelSizelayout_width 和 layout_height屬性的特殊版本android.view.ViewGroup

GetNonResourceString(Int32)

擷取 var<index>/var< 屬性的字串值>,但前提是該字串來自 XML 檔案中的即時值。

GetResourceId(Int32, Int32)

在 var<index>/var< 處取得該屬性>的資源識別碼。

GetSourceResourceId(Int32, Int32)

回傳指定屬性所解析的樣式或版面的資源 ID,否則回傳 defValue。

GetString(Int32)

在 var<index>/var< 處取得屬性>的字串值。

GetText(Int32)

在 var<index>/var< 處取得屬性的樣式字串值>。

GetTextArray(Int32)

在 var<index>/var< 處取得屬性>的 CharSequence[]。

GetTextArrayFormatted(Int32)

在 var<index>/var< 處取得屬性>的 CharSequence[]。

GetTextFormatted(Int32)

在 var<index>/var< 處取得屬性的樣式字串值>。

GetType(Int32)

回傳指定索引的屬性類型。

GetValue(Int32, TypedValue)

在 var<index>/var< 處取得該屬性>的原始 TypedValue。

HasValue(Int32)

判斷是否存在 var<index>/var< 的>屬性。

HasValueOrEmpty(Int32)

判斷是否存在 var<索引>/var< 的>屬性,若該屬性被明確設定為 則true@empty傳,且false僅在該屬性未定義時。

JavaFinalize()

當垃圾回收判定該物件不再有相關參考時,由垃圾回收器呼叫。

(繼承來源 Object)
Length()

回傳這個陣列中的數值數量。

Notify()

喚醒一個正在該物件監視器上等待的執行緒。

(繼承來源 Object)
NotifyAll()

喚醒所有等待該物件監視器的執行緒。

(繼承來源 Object)
PeekValue(Int32)

在 var<index>/var< 處取得該屬性>的原始 TypedValue,並回傳一個暫存物件並儲存其資料。

Recycle()

回收 TypedArray,供後續呼叫者重複使用。

SetHandle(IntPtr, JniHandleOwnership)

設定 Handle 屬性。

(繼承來源 Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
ToArray<T>()

從這個 Java 陣列包裝器建立一個受管理陣列。

(繼承來源 Object)
ToString()

回傳物件的字串表示。

(繼承來源 Object)
UnregisterFromRuntime()

將此 Java 節點從互通執行時中取消註冊。

(繼承來源 Object)
Wait()

導致目前執行緒等待被喚醒,通常是透過 <em>通知</><em 或 em>中斷</em> 來喚醒。

(繼承來源 Object)
Wait(Int64, Int32)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)
Wait(Int64)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)

明確介面實作

名稱 Description
IJavaPeerable.Disposed()

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
IJavaPeerable.Finalized()

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

(繼承來源 JavaObject)
IJavaPeerable.UnregisterFromRuntime()

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

擴充方法

名稱 Description
GetJniTypeName(IJavaPeerable)

取得實例 self類型的 JNI 名稱。

JavaAs<TResult>(IJavaPeerable)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

JavaCast<TResult>(IJavaObject)

執行 Android 執行時檢查型別轉換。

JavaCast<TResult>(IJavaObject)

容器,用於取出的值陣列,並以 Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)Resources#obtainAttributes

TryJavaCast<TResult>(IJavaPeerable, TResult)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

適用於