Add stack views to Stack Views.
- [Instructor] Right now in the app,…the order and back buttons are above and below each other.…Let's take a look at them real quickly again.…We'll go ahead and run.…And they're over here.…What if you wanted to make them…next to each other in a stack view?…The answer is to use another stack view going horizontally…nested inside the first stack view.…Go ahead and stop the app.…Let's go back to the MakiRollsViewController.…And just between the content mode and the subviews…give yourself some space…and I'm gonna add another stack view.…
And we start with a button stack.…So we have our two buttons in here.…Let buttonStack…UIView equals and the array is just…gonna be order button and back button.…OrderButton…backButton.…Then I'll make my buttonStackView…equal to UIStackView,…arrangedSubviews, and that'll be buttonStack.…
And my button stack view will have an axis,…which is horizontal.…Now I'm gonna make this simple compared to…what we've been doing with sizes so far.…So I'll set alignment to fill…and distribution to fill equally for my buttons.…
- 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.