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
Patrick Li
2,434 PointsScreen 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
Stone Preston
42,016 Pointsyou 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
Patrick Li
2,434 Pointsokay
Stone Preston
42,016 Pointsjust 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.
Patrick Li
2,434 Pointsoh okay
Stone Preston
42,016 Pointslet me know what happens, will be interesting to see if that was the issue
Patrick Li
2,434 Pointsfor 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.
Patrick Li
2,434 Pointsand yes my class constraint was checked
Stone Preston
42,016 Pointsmake sure you delete any constraints you had on there before
Stone Preston
42,016 Pointsmake sure you delete any constraints you had on there before
Patrick Li
2,434 PointsPatrick Li
2,434 PointsI 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.
Stone Preston
42,016 PointsStone Preston
42,016 Pointshmm strange. and you have a 5 not a 4/4s correct?
Patrick Li
2,434 PointsPatrick Li
2,434 Pointsyea
Stone Preston
42,016 PointsStone Preston
42,016 Pointssometimes 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
Patrick Li
2,434 PointsPatrick Li
2,434 PointsWell if you think of anything let me know