Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Constraints don't align as expected

I'm taking the course on Swift. When using Auto-layout with the inferred size setting, I'm trying to set standard constraints for a label using the pin, with 20 points on both the leading and trailing edges. However, after adding both constraints, the red bar on my label is still well outside the parameters I set. When I click back into the pin, the two sides no longer say 20. What happened to my constraints? Why isn't the label fitting properly on my view with 20 points on both sides?

1 Answer

Post your code pls