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.

iOS Build a Simple iPhone App with Swift Views and View Controllers Introduction to Views

Craig Francis
Craig Francis
4,195 Points

Everything Off-Center (XCode7)

Following the steps in this video and the next (How To Build a Simple iPhone App: Intro to Views, View Controller and IB Action), results in both button and label being off-center (to the left) and too high when run in XCode7.

Angel Caro
Angel Caro
11,831 Points

If you are using the inferred size view controller everything will be off center without using constraints, try using the 4.7 inch size view controller and see if that works, you also will get this fixed in the next couple of videos by using constraints.

Craig Francis
Craig Francis
4,195 Points

Thanks Angel, that worked great. (While I do know how to fix it with constraints, I was wondering why it wasn't working for me when it was in the video, and didn't want to get too ahead of myself).

Assuming others will be able to see this, if you're having the same problem: Click on the View Controller bit of the middle left hand menu (the Document outline) so it's highlighted, then the 4th tab of the right hand one (Attributes Inspector). Under Simulated Metrics is a Size option to change to 4.7. You'll need to realign things again, but now these bits of the course should work as well for you as they do in the video.