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: Thu, 07 May 2015 08:52:59 -0700
> On May 6, 2015, at 9:10 PM, Luther Baker <email@hidden> wrote:
>
> I'm probably missing something ... but fundamentally, the whole point of constraints between the scrollview and its children is so that the scrollview knows how big to make its contentSize. It sounds like you've got this flipped ... the scrollview is not trying to constrain the size of the document at all - when using autolayout, the scrollview is dynamically trying to determine it's *own* contentSize.
But would it use constraints for that? “contentSize” is a property of the scroll view, not a specific view. The documentView’s parent is the clipView, which does not resize with the content, so it doesn’t seem like there should be a constraint there. This seems more like a job for observing the documentView’s frame rect, either via KVO or NSNotifications.
> I know you skipped that report I sent you - but by doing so, I think you're missing some helpful insight. You post sounds like you're just frustrated it didn't just work in IB ... and you're upset you've finally got to actually learn about this new-fangled layout paradigm.
Kind of. I’ve been working intermittently with auto-layout for a few years on smallish projects, but just figuring it out by messing with IB. I had actually not managed to find the full Auto Layout Guide before, and that should help a lot because I’m the type that likes to learn by curling up with a good book.
> Just my $0.02. I thoroughly enjoy your contributions to this group and I'll just say that this entire thread really surprised me. Hang in there! It isn't that difficult!
Thanks! Yeah, my expertise doesn’t extend to the more modern parts of the UI frameworks. I’ve done a lot of AppKit in the past (mostly on iChat and Chromium) but very little since 2010, as I’ve since been focusing on database and networking code with no UI. And I’ve never done any UIKit beyond little toy demo apps…
—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