Use compression resistance and content hugging priorities to control size.
- [Instructor] When we had no size constraints,…the back button forced the app to set the width and height…to everything else to accommodate…the intrinsic content size of the back button.…Now, it's overrunning everything.…How do we control it when size is based…on entrance at content size?…You use two priorities to do this,…compression resistance and content hugging.…I'll start with content hugging priority.…All priorities are two numbers assigned to a view,…one for vertical and one for horizontal.…Go ahead and stop the app,…close the console,…and go to viewoutload.…
Scroll down to the bottom of it…and we're gonna put some more print statements in there.…First one's gonna be print.…Quote, back button hugging.…And that's gonna be back button inside the parenthesis there…dot content hugging priority.…
And then it asks you for which UI layout constraint access…and I'm gonna do this one vertical.…And that's gonna give something we won't be able…to see too well.…So, I'm actually gonna put a raw value…on the end of this, like so.…
- 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.