title: How to change the position or size of a view in Relative Layout at runtime in xamarin.forms
body: <p>What I did is I have added a label to a relative layout by setting all constraint.</p>
  
  <p>Below is my code for that.</p>
  
  <pre><code>relativeLayout.Children.Add(textLabel, Constraint.RelativeToView(innerBorderBox, (parent, sibling) =&gt;
      {
          return sibling.Width * 0.55;
      }), Constraint.RelativeToView(innerBorderBox, (parent, sibling) =&gt;
      {
          return sibling.Y;
      }), Constraint.RelativeToView(innerBorderBox, (parent, sibling) =&gt;
      {
          return sibling.Width * .45;
      }), Constraint.RelativeToView(innerBorderBox, (parent, sibling) =&gt;
      {
          return sibling.Height;
      }));
  </code></pre>
  
  <p>and it working perfectly.</p>
  
  <p>Now I want to change that label(textLabel) X Constraint and Width Constraint dynamically. For example, from the above code X Constraint is <code>sibling.Width * 0.55</code> and width is <code>sibling.Width * .45</code>, then need to change to X as <code>sibling.Width * 0.55 + 10</code> and width is <code>sibling.Width * .45 - 50</code>. How to do that?</p>
  
  <p>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.</p>