Skip to main content
Question

Width / Height for Autolayout components are automatically set to fixed when resizing

  • August 10, 2022
  • 1 reply
  • 3288 views

Noah_Whitney

When resizing groups / frames that contain autolayout components, I’m having this terrible issue occur that sets the height/width to fixed, which forces the component to scale with the resizing of the group/frame. I set the constraints to specifically stick to the top-left and yet any resize scales all of my buttons. Has anyone dealt with this? Does anyone here have a workaround?

Klesus
  • August 11, 2022

Hi Noah!
It’s very difficult to tell exactly what’s wrong without knowing what object(s) you are resizing and what type it is. If you could share the file it would be helpful.

In the meantime, here are some pointers.

  • Objects inside groups always scale when the group is resized.
  • Objects inside frames behave according to their constraints when the frame is resized.
  • Only objects inside non-autolayout frames have constraints.
  • Autolayout frames children do not use constraints, they use alignments.
  • Autolayout frames control the alignment of its children.
  • Children of an autolayout frame can be either fixed size or grow to fill up as much space as is available. Autolayout frames can be fixed size or shrink until it hugs all its children. If an autolayout frame is also a child of another autolayout frame, then it can also grow.
  • Besides one exception, either the outermost autolayout frame or one of it’s children/grandchildren must be set to fixed width/height.

Reply


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