ViewGroup.GetChildMeasureSpec(Int32, Int32, Int32) Method

Definition

Does the hard part of measureChildren: figuring out the MeasureSpec to pass to a particular child.

[Android.Runtime.Register("getChildMeasureSpec", "(III)I", "")]
public static int GetChildMeasureSpec (int spec, int padding, int childDimension);
[<Android.Runtime.Register("getChildMeasureSpec", "(III)I", "")>]
static member GetChildMeasureSpec : int * int * int -> int

Parameters

spec
Int32

The requirements for this view

padding
Int32

The padding of this view for the current dimension and margins, if applicable

childDimension
Int32

How big the child wants to be in the current dimension

Returns

a MeasureSpec integer for the child

Attributes

Remarks

Does the hard part of measureChildren: figuring out the MeasureSpec to pass to a particular child. This method figures out the right MeasureSpec for one dimension (height or width) of one child view.

The goal is to combine information from our MeasureSpec with the LayoutParams of the child to get the best possible results. For example, if the this view knows its size (because its MeasureSpec has a mode of EXACTLY), and the child has indicated in its LayoutParams that it wants to be the same size as the parent, the parent should ask the child to layout given an exact size.

Java documentation for android.view.ViewGroup.getChildMeasureSpec(int, 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