O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required