Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
Intrinsic Content Size
In the constraints that you have added, you at no point specified a minimum width for the Add Employee button. However, when you try to shrink the width of the window, the scroll view reaches its minimum width, but the Add Employee button’s width stays the same! This is happening because Auto Layout is taking the button’s intrinsic content size into consideration. In the case of a button, its intrinsic content size is determined by its title text.
Auto Layout handles changes to intrinsic content size as well. If you changed the Add Employee button’s title to something longer, the window would be laid out again so that the button’s new title could be displayed fully. It would first shrink the scroll view, and, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access