Re: How to get max size of view according to constraints?
Re: How to get max size of view according to constraints?
- Subject: Re: How to get max size of view according to constraints?
- From: Charles Srstka <email@hidden>
- Date: Tue, 20 Mar 2012 13:46:09 -0500
On Mar 20, 2012, at 1:21 PM, Kyle Sluder wrote:
> It ran the constraints system, solved for the maximum size of the content view, and prevented you from resizing the NSWindow. But it knew what all the subviews were: the empty set. That's not the same as solving the constraints system without regard to subviews.
Sure it is. The developers of the NSWindow object had no idea what views I was going to put into it, so they coded it to dynamically determine its min and max size based on what views it contains at runtime. I’d like to do the same thing with my view class.
Running the constraints system, solving for the maximum size of the content view, and preventing the view from being resized any larger than that is *precisely* what I’d like to do. Is there any way to do this (short of iterating through the constraints and doing the math manually, which is not likely to be future-proof given that Apple could add new constraint types in the future that my view would’t know about)?
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden