Share via


VisualElement.OnSizeRequest(Double, Double) Method

Definition

Caution

OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.

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

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.")]
protected virtual Xamarin.Forms.SizeRequest OnSizeRequest (double widthConstraint, double heightConstraint);
abstract member OnSizeRequest : double * double -> Xamarin.Forms.SizeRequest
override this.OnSizeRequest : double * double -> Xamarin.Forms.SizeRequest

Parameters

widthConstraint
System.Double

The available width for the element to use.

heightConstraint
System.Double

The available height for the element to use.

Returns

A SizeRequest which contains the desired size of the element.

Attributes
System.ComponentModel.EditorBrowsableAttribute System.ObsoleteAttribute

Remarks

The results of this method will be (-1, -1) if the element has not yet been realized with a platform specific backing control. Overriding this method does not require a call to the base class so long as a valid SizeRequest is returned.

Applies to