Learn to code alignment constraints.
- [Instructor] We did the layout for the label in the image.…Now it's time to do the buttons.…I'll put the order and back buttons…on top of each other on the bottom here.…We'll align these buttons with the label.…So go ahead and stop the app.…There's no big change here in how we write constraints.…You use other subviews instead of a superview.…Generally an alignment has a constant of zero.…You'll also use the same edge so a bottom one…will be a bottom on top of the other.…You'll also use the same edge.…
So a bottom attribute on one will be…the bottom attribute on the other.…Scroll to the order button mark.…Make yourself some space and I'll set the order button…aligned to the label's leading and trailing edges.…I'll copy a leading constraint from above…to save myself some time.…Copy.…Paste it here and then modify it…so that it'll be order button leading…equals label leading.…
And then I'll change the constraint to match it.…So here change this image view to order button.…And view to label.…And the multiplier and constant are the same.…
- 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.