Re: Help: NSScrollView is resizing its documentView down to (0, 0)
Re: Help: NSScrollView is resizing its documentView down to (0, 0)
- Subject: Re: Help: NSScrollView is resizing its documentView down to (0, 0)
- From: Jens Alfke <email@hidden>
- Date: Wed, 06 May 2015 09:54:46 -0700
> On May 6, 2015, at 8:36 AM, Uli Kusterer <email@hidden> wrote:
>
> So you're not setting a constraint on the *document* view? How do you expect it to know how to constrain that view otherwise?
The size of the document view is fundamentally unrelated to the size of the clip or scroll view — the whole point of having a scroll view is that you have an arbitrarily large document! So I wouldn’t expect the scroll view to be trying to constrain the size of the document view at all. The app code is in charge of deciding how big the document view is, based on the content it displays.
[OK, in some cases the width of the content view is limited to the width of the clip view. Not in my case though; it scrolls horizontally as well as vertically.]
> IIRC you need to implement updateConstraints to create proper constraints, or intrinsicContentSize, or maybe both.
I’ve never seen the intrinsicContentSize property before (partly because it’s not defined in NSView.h.) Reading the docs for it, it makes sense that I’d override it. And searching the docs for that name I found the “Auto Layout Guide”, which looks very useful but which I wouldn’t have found otherwise because I didn’t know to look for the keyword “auto layout” (everywhere else it’s called “constraints”…)
—Jens
_______________________________________________
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