Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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.