Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide NSCollectionView Scroll indicator

I have an NSCollectionView and I would like to hide the horizontal scroll indicators.

I've tried

        collectionView.enclosingScrollView?.verticalScroller?.isHidden = true

But it is not working.

Thank you in advance.

like image 958
Jonathanff Avatar asked Apr 09 '18 01:04

Jonathanff


People also ask

How do I hide scroll view?

We would use showsVerticalScrollIndicator={false} prop to disable the Scroll bar in scroll view component. This prop would disable the scroll indicator but the scrolling works perfectly.

How do I hide my scroll in react native?

React Native ScrollView and FlatList provide showsVerticalScrollIndicator and showsHorizontalScrollIndicator to hide or remove scroll indicator and both are true default, we have to pass as false to hidel scrollbar.


1 Answers

hidden didn't work for me too.

The only way I found to hack this, is by changing inset:

(scrollViewCollectionView is of type NSScrollView, this example is while creating NSCollectionView programmatically)

scrollViewCollectionView.documentView?.enclosingScrollView?.scrollerInsets = NSEdgeInsets.init(top: 0, left: 0, bottom: 100, right: 0)

Please note: My NSCollectionView is horizontal, and less then 100 height, this is why this hack resolved in a hidden indicator.

like image 144
MCMatan Avatar answered Oct 04 '22 15:10

MCMatan