Re: Split view priority
Re: Split view priority
- Subject: Re: Split view priority
- From: Ken Thomases <email@hidden>
- Date: Fri, 22 Apr 2016 20:56:20 -0500
On Apr 22, 2016, at 7:15 PM, Quincey Morris <email@hidden> wrote:
>
> I have a window that contains a split view of 2 split items. The item on the left is a source list whose width constraint is '>= 70’ @priority 1000. The item on the right is a view whose width constraint is '>= 700’ @priority 1000. The window itself has no minimum size specified in IB or any other way.
>
> What I want is for the left split to start out at width 300, and the right split to start out at width 700. That is, the left split is larger than its minimum size, while the right split is at its minimum size. Then, resizing the window should resize the right split only, as far as possible, compressing the left split down from 300 only when the window gets smaller than its original size. I can achieve that by setting the left split’s holding priority to 751, vs. 750 for the right split. That “preference” for resizing the right split item works.
>
> The problem is, the window is always 770 (70 + 700) wide when it opens, not the desired 1000 (300 + 700). There is no state restoration ATM, so that’s not a factor. IOW, the window is opening at its minimum possible width.
First, the split view holding priorities should generally be less than 490. That's NSLayoutPriorityDragThatCannotResizeWindow. If they are greater than that, then they'll potentially override the window's size.
After that, what is the design-time size of the left split view and the window? You should set them to the default configuration. The window will stay that way so long as there are no constraints of priority 500 (NSLayoutPriorityWindowSizeStayPut) or greater that force it to another size (or the user resizes it manually, of course).
Regards,
Ken
_______________________________________________
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