What I did is I have added a label to a relative layout by setting all constraint.
Below is my code for that.
` relativeLayout.Children.Add(textLabel, Constraint.RelativeToView(innerBorderBox, (parent, sibling) =>
{
return sibling.Width * 0.55;
}), Constraint.RelativeToView(innerBorderBox, (parent, sibling) =>
{
return sibling.Y;
}), Constraint.RelativeToView(innerBorderBox, (parent, sibling) =>
{
return sibling.Width * .45;
}), Constraint.RelativeToView(innerBorderBox, (parent, sibling) =>
{
return sibling.Height;
}));
`
and it working perfectly.
Now I want to change that label(textLabel) X Constraint and Width Constraint dynamically. For example, from the above code X Constraint is sibling.Width * 0.55
and width is sibling.Width * .45
, then need to change to X as sibling.Width * 0.55 + 10
and width is sibling.Width * .45 - 50
. How to do that?
My guess is that it can be done by removing the label for the relative Layout and added again to relative layout with new constraint. But I think there will be a better solution for this.