Xamarin.Forms Guides | Samples

Xamarin.Forms.VisualElement.Measure Method

Returns the minimum size that a visual element needs in order to be displayed on the device.

Syntax

public SizeRequest Measure (Double widthConstraint, Double heightConstraint, MeasureFlags flags)

Parameters

widthConstraint
The suggested maximum width constraint for the visual element to render.
heightConstraint
The suggested maximum height constraint for the visual element to render.
flags
A value that controls whether margins are included in the returned size.

Returns

The minimum size that a visual element needs in order to be displayed on the device.

Remarks

If the minimum sized that the visual element needs in order to be displayed on the device is larger than can be accommodated by widthConstraint and heightConstraint, the return value may represent a rectangle that is larger in either or both of those parameters.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 2.0.0.0