Forum Xamarin.Forms

Using Multiple Properties in Relative Layout Constraint Expressions on XAML

i want to use Height and Y property-

RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=BtnAllRegion, Property=Height+Y, Factor=1, Constant=10}"


  • LandLuLandLu Member, Xamarin Team Xamurai

    Property here is a string value, we can't set it with some "+" expression.
    I think we can achieve that using code behind, set the other constraints in XAML except the YConstraint. Then define that in code behind:

    RelativeLayout.SetYConstraint(customControl, Constraint.RelativeToView(BtnAllRegion, (parent, sibling) =>
        return sibling.Y + sibling.Height;
  • hadwanihardikhadwanihardik Member ✭✭

    Hi guys,
    Can we achieve this using Xaml

Sign In or Register to comment.