Skip to main content
Question

Objcets lose position when auto layout

  • July 8, 2024
  • 3 replies
  • 113 views

Lorenzo_Scozzafava

Hi There, i’m learning auto layout features,

while i’m doing this exercise i have to combine two auto layouted objects in an bigger one. When i create another auto layout the position of the earliers change, and i don’t know how to clean up this mess. Does someone know the solution ?

Thanks !

Here i’m attaching a screenshot, the resault i would like to achieve is one big auto layout wich contains the other two smaller one, but without changing position

This topic has been closed for replies.

3 replies

AlicePackard
  • Active Member
  • 194 replies
  • July 8, 2024

Hey Lorenzo, I would suggest you add left-padding to the bottom part of the UI (the one that contains the play button and white buttons). This will push it to the right and you can make the composition look like the “before” example but all within one big auto layout container.


Lorenzo_Scozzafava

Thanks Alice,

and how about the auto layout properties ? I mean, the bigger one should stay in “hug contents” while the others in “fixed width” ?


AlicePackard
  • Active Member
  • 194 replies
  • July 9, 2024

You’re welcome! Having the parent container hugging on all sides seems good. But that could change if you dropped it inside of a screen, just depends what your needs are for the overall composition.

I would actually recommend using hug on all sides for the two inner containers as well (not fixed)!