2
votes

I have two overlapping views.

  • An NSTableView (the list of songs), I'll call it the table view
  • A layer backed NSView (for the play controls at the bottom), I'll call it the play controls view

I was using layer backed views to render the table view previously and this caused the scroll bar to render behind the play controls view, great! But as I loaded up the table view with 150+ rows of data the app slows down pretty bad as I scroll.

I changed setWantsLayer: to NO and now the table view is much snappier, great! But now the scroll bar seems to render on top of the play controls view.

Good:

enter image description here

Bad:

enter image description here

Any ideas whats going on here? (I'm a core animation rookie if you can't tell)

2

2 Answers

0
votes

Why don't you resize the entire scrollview and put the play controls view below the list? It seems by your sceenshot that the play controls view is a subview of the scrollview. Is this necessary?

0
votes

Resizing the entire scrollVIew could be a solution, but you might as well set the scrollIndicatorInsets:

yourTableView.scrollIndicatorInsets   = NSEdgeInsetsMake(0, 0, bottomValue, 0); 

Here bottomValue would be something like 50 -150, depending on the height of your view, you might have to test this, but this will do the trick.

Edit: I just see you are working on OSX, my solution works on iOS, i hope the NSEdgeInsetsMake works on Max OSX similar to UIEdgeInsetsMake does on iOS.