Skip to main content
Question

How to align one element in a container different from the rest?


I have a container (black square) with 3 green elements that are aligned in the center using auto layout.

Now I want to add a red element in that same container but aligned to the right.

Having a hard time achieving this, can somebody help point me in the right direction?

How can I achieve a result like in the image I attached:

This topic has been closed for comments

2 replies

  • 1 reply
  • September 26, 2023

Did you find out how? I want to do the same thing!


Fernando_Lins

Make the black square into an auto-layout frame and set its Horizontal Gap Between Items to Auto and orientation to horizontal.
image

Wrap the three green elements in an auto-layout frame and set its Horizontal Resizing to Fill and the auto-layout alignment to Center.
image

Now place the red element inside the black square auto-layout frame, to the right of the green element’s auto layout frame.

image


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings