Xamarin.Forms Guides | Samples

Xamarin.Forms.StackLayout.OnSizeRequest Method

This method is called during the measure pass of a layout cycle to get the desired size of the StackLayout.

Syntax

[System.Obsolete("Use OnMeasure")]
protected override SizeRequest OnSizeRequest (Double widthConstraint, Double heightConstraint)

Parameters

widthConstraint
The available width for the StackLayout to use.
heightConstraint
The available height for the StackLayout to use.

Returns

A SizeRequest which contains the desired size of the StackLayout.

Remarks

The results of this method will be a sum of all the desired sizes of its children along the orientation axis, and the maximum along the non-orientation axis.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.3.3.0, 1.4.0.0, 1.5.0.0, 2.0.0.0