1
votes

I am trying to create the following layout with a NSTableView:

layout

A big banner per section on the side and regular text content rows on the right side.

The Image on the left side is the problem. It should behave like a floating section when scrolling (stay below the section header). It seems impossible to have the view part of the NSTableView as each column of a row needs to have the same height.

I already tried a lot of things, but I need some input which is the right direction.

What I tried:

  • Add the image view as a floating view into the NSScrollView? That seems like a good approach, but it doesn't stick on top while scrolling and the (re)positioning within the table is... tricky. Any hints here?
  • Add the view into the section header and disable clipping somehow (to make them larger than the section)? Couldn't make that work.
  • Having a table with NSStackViews per row that host itself tables - that did work, but: Independent selections per table is not what I want.enter image description here
1

1 Answers

0
votes

Ok, I finally found a solution.

The view is added to the floating view container of the NSScrollView that holds the NSTableView. I use the bounds of the row views and translate that to coordinates of the floating view container.

I also modified the selection drawing to make it look good and recalculate the coordinates on animations.