Gene Bogdanovich14,618 Points
Compression Resistance & Content Hugging
Hello. Let's say I want to make name text field and start adventure button the same width. I set the Equal Widths constraint using control drag but it just stretches out the start adventure button. I don't want that. I want the start adventure button to have a size according to its content and text field be the same size as the button. I tried tweaking Compression Resistance and Content Hugging on both elements but it didn't work. How can I work this out? Here's an image of a storyboard: https://ibb.co/h2phSVc Thank you.
Clark Reilly6,204 Points
Your problem is the leading and trailing constraints on the text field. You need to get rid of those before setting it to equal widths with the button. After doing that, it works fine.