Skip to main content

Suppose we have a component - a simple shape, for example, a rectangle.


We place three copies of it in a horizontal autolayout so that their sizes change interconnectedly when the autolayout is stretched left/right.


At the same time, it is important that the third rectangle in the row is in the mask. The width of the mask should always be 1/2 of the width of the other rectangles in the row, according to which the size of the rectangle inside should still change when the autolayout is stretched.


Is it possible to make such a layout?

Hi Artem, Thanks for getting in touch!


You might need to create two separate components, one with a mask and one without.

I’ve tested on my end in that way, the mask maintains 1/2 of the width of the rectangles in the row when resized.

component with mask


If this aligns with your goal, would you mind giving it a try to see if it works?


Hope this suggestion is helpful! If anyone else has ideas on this, feel free to chime in!


Thanks,


Reply