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

Title falls off screen when pinned

All, First of all thanks for any assistance that you might have on this. I have been working on trying to pin a label in the middle of my IOS device by pinning it by 200 on both the leading and trailing edge. However, when i run the app the name falls off of the screen and I get the following error.

"2016-02-19 13:09:48.971 Messing Around[933:305545] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x13f569430 UIView:0x13f556700.trailingMargin == UILabel:0x13f565b30'Application Name'.trailing + 200>", "<NSLayoutConstraint:0x13f569480 UILabel:0x13f565b30'Application Name'.leading == UIView:0x13f556700.leadingMargin + 200>", "<NSLayoutConstraint:0x13f62e630 'UIView-Encapsulated-Layout-Width' H:[UIView:0x13f556700(375)]>" )

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x13f569430 UIView:0x13f556700.trailingMargin == UILabel:0x13f565b30'Application Name'.trailing + 200>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful."

Looks like the two pins can not be fulfilled at one time but i am not sure why not.

Thanks again,

Try horizontal, and vertical constraints...

1 Answer

like jhoan said. just delete the constraints you have, and set center horizontally and vertically. you dont need to change any values