共用方式為


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

所要求的高度條件約束。

傳回

元素需要的要求大小,才能顯示在裝置上。

屬性

適用於