Learn about the errors possible in Auto Layout.
- [Instructor] You've learned about pin,…align, and size constraints,…but I've been careful to use certain examples.…It's very easy to make mistakes,…and have errors in your auto-layout code.…Before you code, you might want to know about…the two most common types of mistakes:…too many constraints, and too few.…Let's look at the buttons again.…Suppose I don't have a constraint…that the buttons are of equal size.…The system has an amount of space to give the buttons…but has no idea how much to give each button.…
This is an ambiguity, a place where there is not enough…constraints to make everything a frame.…Another example would be the label.…I might have the pins for the top and left sides,…and set the height to 20 points,…but I can't figure out a width from that.…That would be ambiguous.…A different error is too many constraints.…If there is a second pin on top the label for 10 points,…the system has a problem deciding…if I want 10 points or 20 points.…
That's a conflicting constraint.…Another conflicting constraint…
- 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.