This is definitely a bug in AppKit. I managed to get this working on 10.8.5 using one of the following solutions:
1) NSScroller subclass (preferred method)
+ (BOOL)isCompatibleWithOverlayScrollers { // Let this scroller sit on top of the content view, rather than next to it. return YES; } - (void)setHidden:(BOOL)flag { // Ugly hack: make sure we are always hidden. [super setHidden:YES]; }
Source : jmk at https://stackoverflow.com/a/167168/
2) Rollback and momentum seem to be broken when using an outdated style. It also partially breaks Apple code scrolling sync . This causes the scroll to scroll to reset the scroll position if it is NSScrollerStyleOverlay
and the other is NSScrollerStyleLegacy
. If the scroll scroll in the overlay style scrolls, the old style scrolls, it resets both types of scroll to the top scroll offset y = 0.
[self.scrollView setHasVerticalScroller:YES]; [self.scrollView setScrollerStyle:NSScrollerStyleLegacy]; [self.scrollView setHasVerticalScroller:NO];
Andrew
source share