VisualElement.OnMeasure(Double, Double) 方法

定义

注意

Use MeasureOverride instead

进行布局测量时调用的方法。

protected:
 virtual Microsoft::Maui::SizeRequest OnMeasure(double widthConstraint, double heightConstraint);
protected virtual Microsoft.Maui.SizeRequest OnMeasure (double widthConstraint, double heightConstraint);
[System.Obsolete("Use MeasureOverride instead")]
protected virtual Microsoft.Maui.SizeRequest OnMeasure (double widthConstraint, double heightConstraint);
abstract member OnMeasure : double * double -> Microsoft.Maui.SizeRequest
override this.OnMeasure : double * double -> Microsoft.Maui.SizeRequest
[<System.Obsolete("Use MeasureOverride instead")>]
abstract member OnMeasure : double * double -> Microsoft.Maui.SizeRequest
override this.OnMeasure : double * double -> Microsoft.Maui.SizeRequest
Protected Overridable Function OnMeasure (widthConstraint As Double, heightConstraint As Double) As SizeRequest

参数

widthConstraint
Double

请求的宽度约束。

heightConstraint
Double

请求的高度约束。

返回

要显示在设备上,元素所需的请求大小。

属性

适用于