• 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: NSSplitViewController contents are shifted at first
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSplitViewController contents are shifted at first


  • Subject: Re: NSSplitViewController contents are shifted at first
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 20 May 2016 07:49:22 -0700

> 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.

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.


_______________________________________________

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: NSSplitViewController contents are shifted at first
      • From: Rick Mann <email@hidden>
References: 
 >NSSplitViewController contents are shifted at first (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Opening a file but not associating with NSDocument
  • Next by Date: Question about orderFront/orderBack etc.
  • Previous by thread: NSSplitViewController contents are shifted at first
  • Next by thread: Re: NSSplitViewController contents are shifted at first
  • Index(es):
    • Date
    • Thread