語言

Resources.GetBoolean(Int32) 方法

定義

回傳與特定資源 ID 相關的布林值。

[Android.Runtime.Register("getBoolean", "(I)Z", "GetGetBoolean_IHandler")]
public virtual bool GetBoolean(int id);
[<Android.Runtime.Register("getBoolean", "(I)Z", "GetGetBoolean_IHandler")>]
abstract member GetBoolean : int -> bool
override this.GetBoolean : int -> bool

參數

id
Int32

由 aapt 工具產生的目標資源識別碼。 此整數編碼套件、類型及資源條目。 值 0 是無效的識別碼。

傳回

回傳資源中包含的布林值。

屬性

例外狀況

如果給定的 ID 不存在,則拋出 NotFoundException。

備註

回傳與特定資源 ID 相關的布林值。 此值可用於任意整數資源值,若非零則回傳真值。

Java 文件 android.content.res.Resources.getBoolean(int)。

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

適用於