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

Screen of the app is weird

When I ran my app on my iPhone 5(fun facts app)(7.0.6), the screen was strange. It would cut off some of the top and also the bottom. I tried changing the size class and that stuff, but it still would cut off at least some part of the app. This only happens when I run it on an actual phone, but not the any of the simulators. Any suggestions would help! Thanks

5 Answers

you will need to set up auto layout constraints in order to make your app look uniform on all devices.

This only happens when I run it on an actual phone, but not the any of the simulators. Any suggestions would help! Thanks

are you sure you ran it on the iPhone 5 sim? try running it on the iPhone 5 simulator. it should have the same problem as your actual device

I did set the auto layout constraints, and i also ran it on all the simulators and it worked. Its just when I tried running on the actually phone, it cut off the top and bottom of the app.

hmm strange. and you have a 5 not a 4/4s correct?

yea

sometimes unexpected things can happen on a device, although most of the times the simulators are pretty reliable. you might try restarting xcode/your computer and building and running again. if it looks right on all the sims it generally looks right on the device

Well if you think of anything let me know

okay

just thought of this: if you are using iOS 7 I dont think the constrain to margins feature of autolayout will work. you may need to remove your constraints and readd them, taking care to uncheck constrain to margins.

oh okay

let me know what happens, will be interesting to see if that was the issue

for some reason, I can't add the constraints correctly. I want to center it horizontally and vertically, but it won't let me do it.

and yes my class constraint was checked

make sure you delete any constraints you had on there before

make sure you delete any constraints you had on there before