次の方法で共有


TypedArray.GetLayoutDimension Method

Definition

Overloads

GetLayoutDimension(Int32, Int32)

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes.

GetLayoutDimension(Int32, String)

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes.

GetLayoutDimension(Int32, Int32)

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes.

[Android.Runtime.Register("getLayoutDimension", "(II)I", "GetGetLayoutDimension_IIHandler")]
public virtual int GetLayoutDimension (int index, int defValue);
[<Android.Runtime.Register("getLayoutDimension", "(II)I", "GetGetLayoutDimension_IIHandler")>]
abstract member GetLayoutDimension : int * int -> int
override this.GetLayoutDimension : int * int -> int

Parameters

index
Int32

Index of the attribute to retrieve.

defValue
Int32

The default value to return if this attribute is not default or contains the wrong type of data.

Returns

Attribute dimension value multiplied by the appropriate metric and truncated to integer pixels.

Attributes

Exceptions

if the TypedArray has already been recycled.

Remarks

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes. This is only here for performance reasons; applications should use #getDimensionPixelSize.

Java documentation for android.content.res.TypedArray.getLayoutDimension(int, int).

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

GetLayoutDimension(Int32, String)

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes.

[Android.Runtime.Register("getLayoutDimension", "(ILjava/lang/String;)I", "GetGetLayoutDimension_ILjava_lang_String_Handler")]
public virtual int GetLayoutDimension (int index, string? name);
[<Android.Runtime.Register("getLayoutDimension", "(ILjava/lang/String;)I", "GetGetLayoutDimension_ILjava_lang_String_Handler")>]
abstract member GetLayoutDimension : int * string -> int
override this.GetLayoutDimension : int * string -> int

Parameters

index
Int32

Index of the attribute to retrieve.

name
String

Textual name of attribute for error reporting.

Returns

Attribute dimension value multiplied by the appropriate metric and truncated to integer pixels.

Attributes

Exceptions

if the TypedArray has already been recycled.

if the attribute is defined but is not a dimension or integer (enum).

Remarks

Special version of #getDimensionPixelSize for retrieving android.view.ViewGroup's layout_width and layout_height attributes. This is only here for performance reasons; applications should use #getDimensionPixelSize.

This method will throw an exception if the attribute is defined but is not a dimension or integer (enum).

Java documentation for android.content.res.TypedArray.getLayoutDimension(int, java.lang.String).

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