• 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: Kyle Sluder <email@hidden>
  • Date: Tue, 20 Mar 2012 11:21:14 -0700

On Mar 20, 2012, at 11:14 AM, Charles Srstka wrote:

> On Mar 20, 2012, at 1:03 PM, Kyle Sluder wrote:
>
>>> What I’m trying to find is the upper limit on the width and height
>>> according to the current set of constraints at runtime, when I don’t
>>> necessarily know what the subviews or their constraints are.
>>
>> I do not believe this question makes sense from the perspective of the
>> layout system.
>
> Sure it does. For example, take a view that has a maximum width, per its constraints, and make it the content view of an NSWindow. Now run the app and play around with resizing the window by dragging its edges. Notice how once you try to resize it to a width greater than the view’s maximum width, NSWindow stops resizing it any wider and keeps the width at the maximum. Somehow, NSWindow has figured out the maximum width of the view and adjusted its resize requests accordingly. How does it do that?

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.

--Kyle Sluder
_______________________________________________

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: Charles Srstka <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>)

  • Prev by Date: Re: SSL NSURLConnection to fake-cert server?
  • Next by Date: Re: SSL NSURLConnection to fake-cert server?
  • 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