• 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: Per Bull Holmen <email@hidden>
  • Date: Wed, 21 Mar 2012 14:54:44 +0100

Den 01:13 21. mars 2012 skrev Charles Srstka
<email@hidden> følgende:
> On Mar 20, 2012, at 7:00 PM, Peter Ammon wrote:
>
>> 2. Establish another constraint that says the height of the document view equals the height of the scroll view. Give this constraint a priority lower than required. What its priority should be depends on how tightly you want the document view to fill the scroll view, i.e. which other constraints it should be allowed to break.
>
> This sounds great in concept, but the height I want (if the constraints will allow it) is the scroll view’s documentVisibleRect, not its frame, since the latter includes the size of the scroll bars if they’re visible, and I don’t think that’s doable directly via constraints. However, watching the scroll view’s NSViewFrameDidChangeNotification and manually adding non-required constraints to the size I get from -documentVisibleRect (and clearing out those constraints the next time) works like a champ. As you point out, the mistake I was making before was calling setFrame: here instead of doing this via constraints. Thanks!

I am old school and know nothing about constraints, but given your
descriptions, perhaps you can tie the document view size to the clip
view size (which is also called content view) instead of the scroll
view size?

Per

_______________________________________________

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: Peter Ammon <email@hidden>)
 >Re: How to get max size of view according to constraints? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: NSDate interval formatting
  • Next by Date: asynchronous nsurlconnection in nsoperation
  • 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