• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get max size of view according to constraints?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to get max size of view according to constraints?
      • From: Kyle Sluder <email@hidden>
References: 
 >How to get max size of view according to constraints? (From: Charles Srstka <email@hidden>)
 >Re: How to get max size of view according to constraints? (From: Richard Somers <email@hidden>)
 >Re: How to get max size of view according to constraints? (From: Charles Srstka <email@hidden>)
 >Re: How to get max size of view according to constraints? (From: Kyle Sluder <email@hidden>)
 >Re: How to get max size of view according to constraints? (From: Charles Srstka <email@hidden>)
 >Re: How to get max size of view according to constraints? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: SSL NSURLConnection to fake-cert server?
  • Next by Date: Re: How is this an "incorrect decrement of a reference count"?
  • Previous by thread: Re: How to get max size of view according to constraints?
  • Next by thread: Re: How to get max size of view according to constraints?
  • Index(es):
    • Date
    • Thread