Re: NSSplitViewController contents are shifted at first
Re: NSSplitViewController contents are shifted at first
- Subject: Re: NSSplitViewController contents are shifted at first
- From: Rick Mann <email@hidden>
- Date: Fri, 20 May 2016 16:24:50 -0700
> On May 20, 2016, at 07:49 , Jerry Krinock <email@hidden> wrote:
>
>
>> On 2016 May 20, at 00:00, Rick Mann <email@hidden> wrote:
>>
>> I have a Storyboard using autolayout constraints. I have an NSWindowController with an NSSplitViewController as its content view controller. That has two sub controllers. The left one has an NSOutlineView that has top,left,right, and bottom constraints to its containing view, and a width >= 200. The contents come via bindings. The right controller has no views, just the main view.
>>
>> When the window is first displayed, You can see the two panes, but you can't see the contents of the left pane. If you resize the window vertically a bit, then they snap into position. You can also see that at first, the dot in the middle of the split view slider is not actually in the middle. Once you resize the window a bit, it snaps into the center.
>>
>> IB doesn't let me set any other constraints on things. I don't know how the various nested view controllers set up the constraints on their views.
>
> Rick, referring to the coincidence with your other post yesterday, it seems like you’re working on the same app I was working on earlier last year :)
>
> From my experience, I would say: Don’t push too hard on Auto Layout with NSSplitView. I would remove that >= 200 constraint and set the split fraction in your storyboard, or programatically.
How do I set that? IB doesn't let me adjust the position of the split, and I see no properties on either NSSplitViewController or NSSplitView that let me specify it.
> Although it’s solving a slightly different problem than yours (actually, kind of the opposite sidebar behavior), you might want to have a look at this demo project.
>
> https://github.com/jerrykrinock/SplitViewSidebar
>
> It shows how to set and "constrain” split view sizes, and contains some useful comments and tips regarding NSSplitView and Auto Layout.
Thanks, I'll check it out.
--
Rick Mann
email@hidden
_______________________________________________
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