Learn what the safe area is, why it is there, and when you want to use it.
- You've just made your first auto-layout code.…We are ready to run.…Change your simulator to the iPhone 10, build, and run.…When the list appears, select French toast.…The French toast image appears as the full screen background…but the label is cut off by the navigation bar.…Press Command + left arrow to rotate the phone.…The iPhone 10's notch now blocks the label.…Let's explore what's going on here and how to prevent it.…
So far, we've been using the view's frame…for the relationship to the sub views.…However, there's several areas, like navigation bars,…tool bars, and that iPhone 10 notch…that can get in the way of those.…There's a special area called the safe area that has…boundaries that contextually take those into account.…Let's add those to our project.…First of all, rotate the phone back…with the Command + right arrow and then stop the app.…You can close up the console to give yourself some space.…
And now go to the label layout for top.…So I'm gonna go to my label layouts.…And label top view.top + 40 here.…
- When and why to use Auto Layout programmatically
- Creating constraints in Swift
- Resolving errors in Auto Layout
- Using the safe area
- Working with the Visual Format Language
- Adding a stack view
- Harnessing the power of inequalities and priorities in constraints
- Understanding traits and size classes
Skill Level Intermediate
Learning LayoutTest for iOS Developmentwith Kyle Sherman1h 43m Intermediate
Designing iOS and Android Appswith Renata Phillippi1h 6m Intermediate
1. Basic Concepts in Auto Layout
2. Coding Constraints
3. The Visual Format Language
4. Stack Views
5. Advanced Layout
6. Size Classes
Next steps1m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.