On Apr 10, 2014, at 6:25 AM, Jonathan Mitchell <li...@mugginsoft.com> wrote:
> 
> On some occasions I want my controls to collapse and set a width defining 
> constraint constant to zero.

In general, views should not be resized to zero width or height. A lot of times 
things will break internally (divide by zero errors or visual artifacts). This 
was even more likely in the days of springs and struts, when shrinking a view 
to zero width/height meant -resizeWithOldSuperviewSize: lost all the 
information necessary to apply springs and struts.

> 
> Is the only workaround to wrap such controls in another view and collapse the 
> superview instead?

If you want to remove a view, you should really remove it from its superview. 
You could look into NSStackView, which will do this automatically if 
constraints cannot be satisfied.

--Kyle Sluder

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to