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: Richard Somers <email@hidden>
- Date: Tue, 20 Mar 2012 07:16:05 -0600
On Mar 19, 2012, at 10:20 PM, Charles Srstka wrote:
> As everyone knows, if you have a view with a bunch of subviews and you’ve got NSLayoutConstraints set up for everything, in many cases you might end up with a minimum or maximum size for the view beyond which the constraints are impossible to satisfy, and if you try to resize the view outside these bounds either in IB or in the actual program (if the view is the content view of a resizable window, for example), the resizing will simply stop at those boundaries.
I have worked with constraints in another system and one of the things I learned is that a collection of constraints must be "exercised" or driven from one extreme to the other in order to have confidence that they are correct. If you have a min or max size condition for the view beyond which the constraints are impossible to satisfy, but this in not what you want, then you need to change the constraints so that you get what you want under all conditions. The constraint engine is mathematically correct and does not lie. So if there is a problem, it is in how you are specifying and arranging the constraints or in the number of constraints you have.
--Richard
_______________________________________________
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