Resources.GetDrawableForDensity Resources.GetDrawableForDensity Method

Definition

Overloads

GetDrawableForDensity(Int32, Int32) GetDrawableForDensity(Int32, Int32)

Return a drawable object associated with a particular resource ID for the given screen density in DPI.

GetDrawableForDensity(Int32, Int32, Resources+Theme) GetDrawableForDensity(Int32, Int32, Resources+Theme)

Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.

GetDrawableForDensity(Int32, Int32) GetDrawableForDensity(Int32, Int32)

Warning

This API is now obsolete.

Return a drawable object associated with a particular resource ID for the given screen density in DPI.

[Android.Runtime.Register("getDrawableForDensity", "(II)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_IIHandler", ApiSince=15)]
[System.Obsolete("deprecated")]
public virtual Android.Graphics.Drawables.Drawable GetDrawableForDensity (int id, int density);
abstract member GetDrawableForDensity : int * int -> Android.Graphics.Drawables.Drawable
override this.GetDrawableForDensity : int * int -> Android.Graphics.Drawables.Drawable

Parameters

id
Int32 Int32

The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.

density
Int32 Int32

the desired screen density indicated by the resource as found in DisplayMetrics.

Returns

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

GetDrawableForDensity(Int32, Int32, Resources+Theme) GetDrawableForDensity(Int32, Int32, Resources+Theme)

Return a drawable object associated with a particular resource ID for the given screen density in DPI and styled for the specified theme.

[Android.Runtime.Register("getDrawableForDensity", "(IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;", "GetGetDrawableForDensity_IILandroid_content_res_Resources_Theme_Handler", ApiSince=21)]
public virtual Android.Graphics.Drawables.Drawable GetDrawableForDensity (int id, int density, Android.Content.Res.Resources.Theme theme);
abstract member GetDrawableForDensity : int * int * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable
override this.GetDrawableForDensity : int * int * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable

Parameters

id
Int32 Int32

The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.

density
Int32 Int32

The desired screen density indicated by the resource as found in DisplayMetrics.

theme
Resources.Theme Resources.Theme

The theme used to style the drawable attributes, may be null.

Returns

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to