Sdílet prostřednictvím


View.Measure(Int32, Int32) Method

Definition

This is called to find out how big a view should be.

[Android.Runtime.Register("measure", "(II)V", "")]
public void Measure (int widthMeasureSpec, int heightMeasureSpec);
[<Android.Runtime.Register("measure", "(II)V", "")>]
member this.Measure : int * int -> unit

Parameters

widthMeasureSpec
Int32

Horizontal space requirements as imposed by the parent

heightMeasureSpec
Int32

Vertical space requirements as imposed by the parent

Attributes

Remarks

This is called to find out how big a view should be. The parent supplies constraint information in the width and height parameters.

The actual measurement work of a view is performed in #onMeasure(int, int), called by this method. Therefore, only #onMeasure(int, int) can and must be overridden by subclasses.

Java documentation for android.view.View.measure(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

See also

  • <xref:Android.Views.View.OnMeasure(System.Int32%2c+System.Int32)>