Align views in a Visual Format string.
- [Instructor] In the current layout,…you have the order button hanging out…all the way to the lower right.…Why is it there, and how can we change…its position easily?…That is where alignment becomes important…in the visual language.…Stop the app.…Look at the horizontal constraint again.…It gave a lot of expositioning information…in the string, but no why information.…That's actually done in the options parameter…of the constraints method.…Currently, it is set to align all bottom.…
Replace that with a period.…And auto complete will show you all the options available.…Not all of this will work with every constraint.…Horizontal constraints only work with vertical alignments…like alineAllTop or alignAllFirstBaseline.…Select alignAllTop.…Run, and the order button, will move to the top.…
Okay, stop the app.…Change it to alignAllFirstBaseLine.…Run again.…Click hamburger.…And now it's centered on the baseline.…You can do the same thing with the label.…Stop the app.…And I'm first gonna change this one back to alignAllTop.…
And then down here, I'm gonna change the 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.