Use intrinsic content size and size ranges to control size.
- While you can write two inequalities for a range with code…there's one visual format language trick yet to show you.…Head to the label view to format strings.…You'll notice that the vertical one…re-added some inequalities to it.…Now we're using one image here.…Suppose we would be displaying images in different sizes.…I'd like to remain in a visible range.…I could put more than one inequality in a view's size.…Before I do, I'm going to change the metrics.…
I earlier talked about intrinsic content size,…and I used other things that aren't as reliable,…such as line height, and image view size height,…which isn't optional and that's got all kinds of problems.…So it's better to use here intrinsic content size.…So I'm gonna get rid of this, and change this…to label dot intrinsic content size dot height.…
And I'm also gonna change this image height…to image view dot intrinsic content size dot height.…Now I'm sure I'm getting the correct intrinsic content size.…I know exactly what that image is as the file came through,…
- 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.