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: Roland King <email@hidden>
- Date: Wed, 06 May 2015 13:14:57 +0800
> On 6 May 2015, at 09:21, Jens Alfke <email@hidden> wrote:
>
>
>> On May 5, 2015, at 5:54 PM, Roland King <email@hidden <mailto:email@hidden>> wrote:
>>
>> Constrain the scrollview to something above it if it needs it, if it’s the whole window, probably doesn’t.
>> Constrain the clipview to all 4 sides of the scrollview.
>> Constrain your view to the top, right and left of the clipview but not the bottom.
>> Override the clipview and return isFlipped=YES
>
> I was assuming that the "Editor > Embed In > Scroll view" command would set things up to basically work. (The way it used to in the old days.) Whereas the reality is that IB creates the enclosing views for me, but then helpfully avoids actually setting up any of the constraints they need? WTF?
>
> Also, where does one go to learn that the above constraints are needed? Is this just knowledge picked up through trial and error?
>
> I reallllly don't want to sound like one of those old farts grousing about the old days, but when I learned Cocoa programming in 2000 I was blown away by how easy everything was and how well IB worked. If I were starting out now, I don't think I'd feel the same way.
I think we discussed the last time whether or not that counted as a bug, that it didn’t add the constraints for you. I’m on the fence about that one and can’t find the last discussion. Perhaps setting the constraints up for a ‘usual’ layout of vertically scrolled content would not be unreasonable.
One of the things you ‘pick up’ as you learn autolayout is that when frame sizes disappear to {0,0} that often means you have an ambiguous layout and you need more constraints. Autolayout does have a learning curve but once you start thinking in the right terms it’s not that hard, until you try using it for animation, at which point I end up tearing my hair out on OSX at least. The constraints editor in IB has become an awful lot better since autolayout originally showed up, I now mostly find it fairly quick to look at my layouts and get a mental picture of how the constraints work.
_______________________________________________
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