Auto Layout is Xcode and iOS's way of handling different device sizes, aspect ratios, and resolutions. This video explains the basics of Auto Layout in Xcode 8.
- [Voiceover] So we've looked at viewing our applications…as different devices inside of interface builder,…but what if we wanted to actually design our user interfaces…so they adapt to different screen size?…You can do that with a feature called auto-layout.…Auto-layout enables you to pin objects…to the edges of the screen or to other object,…and you can control the distances between them.…So let's look at how this feature works in Xcode.…
So right now I'm viewing as an iPhone SE,…and that is important.…If I switch the view to another device,…like an iPhone 8, or an iPhone X,…you'll see that this space is completely different.…So we have the right label…not being at the right edge anymore.…So going back to the iPhone 8,…there's still that space there,…but if we look at the iPhone SE,…or iPhone 4S, we don't have that space…because they are the same width.…
Let's go back to iPhone SE.…And let's say we want to create auto-layout pins.…To do that, you just right-click and drag…from the user interface element you want to pin…
Released
9/27/2017- Working with storyboards
- How the Attributes Inspector is organized
- Setting custom classes for UI objects with the Identity Inspector
- Troubleshooting Auto Layout issues
- Modifying constraints with the Size Inspector
- Automatically expanding object sizes with constraints
- Configuring the date picker control
Share this video
Embed this video
Video: Auto Layout fundamentals