xamarin表单支持RelativeToView
Color="Red"
RelativeLayout.WidthConstraint ="{ConstraintExpression
Type=RelativeToParent,
Property=Width,
Factor=0.6,
Constant=0}"
RelativeLayout.XConstraint ="{ConstraintExpression
Type=RelativeToParent,
Property=X,
Constant=20}" />
Color="Blue"
RelativeLayout.WidthConstraint ="{ConstraintExpression
Type=RelativeToParent,
Property=Width,
Factor=0.6,
Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression
Type=RelativeToView,
ElementName=topBox,
Property=Y,
Constant=40}"
RelativeLayout.XConstraint="{ConstraintExpression
Type=RelativeToView,
ElementName=topBox,
Property=X,
Constant=0}" />
希望能帮助到你