Skip to main content

Command Palette

Search for a command to run...

Stackview woes

Published
•1 min read•View as Markdown

Compression resistance and content hugging woes.

Sigh.

Some things to remember

Constraints trump CRP and CHP

  • As in, if you have set a height and width, then that element won't try to grow or shrink, irrespective of its CRP and CHP
  • Constraints have an automatic priority of 1000. That's why they trump CRP and CHP. If you update that priority.. then bets are off.

image.png

CRP and CHP of elements INSIDE the stackview are important

Situation

  • You have two labels in a vertical stackview
  • These labels, in turn, are in a horizontal stackview
  • If you want your labels to take up lots of space, or to hug tight, then you have to update the CRP and CHP of the label itself.
    • updating the CRP / CHP of the vertical stackview will NOT make the change you want
1 views

More from this blog

CoderLyn's developer journey

136 posts

I'm an iOS developer, helping millennials with their finances through US neo-bank, Empower.

Before making the switch to development, I was a strategist and GM in the tech space.