共用方式為


Resources.GetBoolean(Int32) 方法

定義

傳回與特定資源標識符相關聯的布爾值。

[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 是無效的識別碼。

傳回

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

屬性

例外狀況

如果指定的標識碼不存在,則會擲回 NotFoundException。

備註

傳回與特定資源標識符相關聯的布爾值。 這可以搭配任何整數資源值使用,如果不是零,則會傳回 true。

android.content.res.Resources.getBoolean(int)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於