Re: Do NSStackView's actually work in a NSTableView?
Re: Do NSStackView's actually work in a NSTableView?
- Subject: Re: Do NSStackView's actually work in a NSTableView?
- From: Sebastien Boisvert <email@hidden>
- Date: Mon, 06 Apr 2015 12:56:45 -0400
Yes I did make sure it had constraints.
To better illustrate, I’ve uploaded my test app to a repo on github: https://github.com/sebastienboisvert/stackViewTableViewTest <https://github.com/sebastienboisvert/stackViewTableViewTest>
The app has two windows: one with a single stackview only (which has the desired behaviour), and the other with a tableview that contains stackviews. Currently, both stackviews are configured exactly the same in IB. My goal is to have the stackviews in the tableview behave the same as the one in the single window.
You’ll see that in the single stackview window the stack will compress the label, and drop the button views as needed; I’ve tried achieving the same behaviour in the tableview version, but the best I ever got was compression (no dropping) of all the views, which isn’t what I want (the current configuration clips the views as the tableview width shrinks).
Ideally I want the right label to compress and not clip, then the buttons to drop, before the left label starts truncating. The checkbox at left should never drop (note that I haven’t gotten that fully working in the single stackview yet in this demo, I’m mostly trying to get the tableview stacks to behave similarly for now).
I’m not sure if this is an issue with my configuration of the views, or if there’s some extra configurations that need to be done higher up the hierarchy (NSTableRowView/NSTableCellView//NSTableView?)
> On Apr 3, 2015, at 6:58 AM, Jonathan Mitchell <email@hidden> wrote:
>
> Obviously I am not sure whether you are introducing the NSStackView in to the table view in in IB or in code.
> Have you made sure that the NSStackView is fully constrained within the NSTableCellView?
>
> IB by default does not add constraints to NSView child items added to NSTableCellView instances.
>
>> On 3 Apr 2015, at 04:52, Sebastien Boisvert <email@hidden> wrote:
>>
>> I only ask because I’m using a stackview that while it behaves as I configured it in a plain view in a window, it behaves completely different when put in a tableview. For example, views which I’ve set to detach will never, ever detach, regardless of the settings I’ve set.
>>
>> Anyone have experience with using stackviews in tableviews?
>> _______________________________________________
>>
>> 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
>
>
> _______________________________________________
>
> 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
_______________________________________________
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