Context.GetDrawable(Int32) 方法

定義

傳回與特定資源識別碼相關聯的可繪製物件,並設定目前主題的樣式。

[Android.Runtime.Register("getDrawable", "(I)Landroid/graphics/drawable/Drawable;", "")]
public Android.Graphics.Drawables.Drawable? GetDrawable (int id);
[<Android.Runtime.Register("getDrawable", "(I)Landroid/graphics/drawable/Drawable;", "")>]
member this.GetDrawable : int -> Android.Graphics.Drawables.Drawable

參數

id
Int32

aapt 工具所產生的所需資源識別碼。 這個整數會編碼封裝、類型和資源專案。 值 0 是不正確識別碼。

傳回

可用來繪製此資源的物件。

屬性

例外狀況

如果指定的識別碼不存在,則為 。

備註

傳回與特定資源識別碼相關聯的可繪製物件,並設定目前主題的樣式。

android.content.Context.getDrawable(int) JAVA 檔。

此頁面的部分是根據 原始碼專案所建立和共用的工作進行修改,並根據中所述的詞彙使用。

適用於