Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide scrollers while leaving scrolling itself enabled in NSScrollView

I'd like to hide the NSScrollers of NSScrollView. I'm aware of the methods setHasHorizontalScroller: and setHasVerticalScroller:. However, if I disable the scrollers, scrolling in that direction gets disabled as well. I'd like to only hide the scrollers while maintaining the possibility to scroll. Any thoughts on this?

like image 852
mplappert Avatar asked Feb 20 '12 16:02

mplappert


1 Answers

if collectionView.enclosingScrollView?.hasHorizontalScroller == true {
  collectionView.enclosingScrollView?.horizontalScroller?.scrollerStyle = .overlay
  collectionView.enclosingScrollView?.horizontalScroller?.alphaValue = 0.0
} else {
  print("horizontalScroller")
}

Make sure horizontal scroller is selected:

enter image description here

like image 104
Ashish Avatar answered Oct 14 '22 10:10

Ashish