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
Junaid Abdurahman
Courses Plus Student 108 PointsMake app work different screen sizes- Xcode
I wrote a simple quiz app on Xcode which was rejected because the UI got cut off on smaller devices. How do I mak it so that the UI fits any screen size. This is my first app so I'm all new to this.
Language- Swift
1 Answer
Bradley Jackson
2,668 PointsWhen you're working on your app in your Interface Builder (StoryBoard), on the bottom right portion of your screen are what control something called Auto Layout.
On Apple's developer documentation on this, they say it is used for:
Auto Layout in Xcode 5 provides powerful workflows for rapidly and easily creating and maintaining constraint-based layouts in OS X and iOS apps. With Xcode 5, you can:
+Add constraints when you are ready
+Quickly add constraints using control-drag or menu options
+Update constraints and frames separately
+Specify placeholder constraints for dynamic views
+See, understand, and resolve issues with conflicting constraints or ambiguous views
With this said, I think you should look into how to apply Auto Layout and it's quite simple to understand if you watch video or read a tutorial.
Alex Adamo
9,920 PointsAlex Adamo
9,920 PointsYou will have to use Auto Layout in storyboard if you want stuff to resize automatically.