Resources.GetValueForDensity(Int32, Int32, TypedValue, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与具有关联密度的资源关联的原始值。
[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
- resolveRefs
- Boolean
如果为 true,则遵循对另一个资源的引用的资源,以便收到实际的最终资源数据。 如果为 false,则 TypedValue 将填充引用本身。
- 属性
例外
如果给定 ID 不存在,则引发 NotFoundException。
注解
获取与具有关联密度的资源关联的原始值。
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
另请参阅
- <xref:Android.Content.Res.Resources.GetValue(System.String%2c+Android.Util.TypedValue%2c+Android.Util.TypedValue)>