語言

Resources.GetValueForDensity(Int32, Int32, TypedValue, Boolean) 方法

定義

取得與相關密度資源相關的原始值。

[Android.Runtime.Register("getValueForDensity", "(IILandroid/util/TypedValue;Z)V", "GetGetValueForDensity_IILandroid_util_TypedValue_ZHandler")]
public virtual void GetValueForDensity(int id, int density, Android.Util.TypedValue? outValue, bool resolveRefs);
[<Android.Runtime.Register("getValueForDensity", "(IILandroid/util/TypedValue;Z)V", "GetGetValueForDensity_IILandroid_util_TypedValue_ZHandler")>]
abstract member GetValueForDensity : int * int * Android.Util.TypedValue * bool -> unit
override this.GetValueForDensity : int * int * Android.Util.TypedValue * bool -> unit

參數

id
Int32

資源識別碼

density
Int32

密度以DPI計算

outValue
TypedValue

然後 TypedValue 接收資源價值。

resolveRefs
Boolean

如果屬實,會追蹤一個指向另一個資源的資源,這樣你才能獲得實際的最終資源資料。 若為 false,TypedValue 將被填入該參考。

屬性

例外狀況

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

備註

取得與相關密度資源相關的原始值。

Java 文件 android.content.res.Resources.getValueForDensity(int, int, android.util.TypedValue, boolean)。

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

適用於

另請參閱

  • <xref:Android.Content.Res.Resources.GetValue(System.String%2c+Android.Util.TypedValue%2c+Android.Util.TypedValue)>