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 Build a Simple iPhone App with Swift Improving Our User Interface Positioning and Size

Max Pinomaa
Max Pinomaa
2,647 Points

"Update frames" fails, getting 40 left margin

Hello, I tried to do this already twice but I keep getting this same problem. I do the 20 constraints to left and right in the "add new constraints". I align the textlabel vertically from "align". Then I look at the issues behind the yellow flag. Mine is expecting 40 and the constraint is 20. When I hit "Update frames" the text label jumps to a 40 left margin and, even more offensively, gives no margin on the right side. What should I do to fix this?

Have you find any solution for this? I am having the same problem :( Pasan Premaratne

1 Answer

Pasan Premaratne
STAFF
Pasan Premaratne
Treehouse Teacher

Could you post a screenshot of the constraints on the label? If you click on the label, in the Utilities panel under the Size inspector you should see all your constraints

Pasan Premaratne

Something that worked for me was that I made the left and right constraints to 0, and everything else as instructed. I was using the iPhone 7 view, I don't know if that makes any different. Right now I don't have access to the project. I will post it this evening east time.