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 Objective-C Improving Our User Interface Implementing Auto Layout

Kyle Lamse
Kyle Lamse
5,805 Points

My Label after vertically centering it gets pushed down to the middle of the screen. I did everything you did.

I repeated the exact steps you did but my label stay near the center of the screen horizontally.

Did you ever find out why it did that?

I'm having the same issue where the label is actually below my button when testing on the iPhone 6. (Using Xcode 7.)

2 Answers

I ran into the same issue where the label and button were right on top of each other using Xcode 7.1 on all iPhone sizes.I fixed it, but I didn't capture the exact difference. What I do know is that for all top to bottom constraints, there should only be a constraint from the funFactLabel to the topLayout guide, and the Align Center x to the button. The button should only be constrained from the bottom layout guide. I believe there was an extra constraint added or the wrong type with the newer version of Xcode, so the video isn't 100% accurate.

Let me know if this helps!

Tyler Armstrong
Tyler Armstrong
13,887 Points

I'm having the same exact issue in Xcode 7.2. I've watched the video several times doing the exact same steps and my label ends up in the middle of the screen. Frustrating...

The vertical and horizontal constraints seem to be causing the label to appear in the exact center of the screen (which makes sense), but I have no idea why the behavior is different for Pasan's screen. I also noticed at 7:34 that my contain to margins are 27 and 28 versus 31 and 32 as Pasan's. For the life of me I cannot figure out why.