Height or Width of an Element equal to another

Hello, can I make the height of my rectangle equal to that of another rectangle? like always the same size?

Hi @Albraa_Alsakor

1 - Variable

  1. Create a number variable (for example rect_height) and assign it a value (240px)
  2. Create your two rectangle
  3. Assign the previously defined variable to both
  4. Now, both your rectangle have the same height (if you want to change its value, you’ll need to do it from the variable panel)

2 - Auto-layout method

Disclaimer: For this two work, your rectangle has to be part of the same frame

You can use the Auto-layout feature to do so.

  1. Create the first rectangle with the given height
  2. Wrap it in a auto-layout frame (click on your rectangle and do Shift+A)
  3. set the height of the auto-layout to Hug
  4. Add you second rectangle into the auto-layout frame and set its height to Fill
    You can now change the height of your first rectangle and you will see that the second one will adapt

Hope it helped

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.