Prevent NSScrollView from flashing its scroller

144 views Asked by At

I would like to prevent a subclass of NSScrollView from flashing its scroller.

I tried to override -[NSScrollView flashScrollers] with empty implementation, but it does not work.

Any suggestion?

1

There are 1 answers

0
Dinh Viêt Hoà On

If you hide the NSScrollView before setting the scroll position and show it again, it will prevent the scrollbars from flashing.

Here's a code sample:

[_scrollView setHidden:YES];
[[_scrollView contentView] scrollToPoint: NSMakePoint(0, scrollPosition)];
[_scrollView reflectScrolledClipView:[_scrollView contentView]];
[_scrollView setHidden:NO];