Im developing an app targeting mobile devices and want to hide the scrollbar at the side. I selected the scroller with .unity-scroller, but display: none; doesnt seem to work. The only way I slightly got this to work by selecting all its children with .unity-scroller *. The objects were removed, but the space needed for the bar was still “reserved”. Only the visibilty property seemed to work correctly on this very selector.
I know that there has been a very similar question here:
My Problem is, that the display attribute doesnt seem to have any effect.
We play with the display style through code depending on the visibility mode you’re in. The default mode for scroll views was to show only the scrollbar when content was larger than the viewport.
We added a public API to ScrollView to control scrollers visibility. horizontalScrollerVisibility and verticalScrollerVisibility.
You should be able to query the ScrollView and setting that property by doing listView.Q<ScrollView>().verticalScrollerVisibility = ScrollerVisibility.Hidden;