Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hide a vertical scrollbar (without disabling it)?

I have a list but want to hide the scrollbar but still keep the functionality. If I put verticalScrollPolicy="off", this disables scrolling via the mousewheel on windows (100% of my users use windows). How can I hide the scrollbar visually but keep the ability to scroll via the keyboard as well as the mousewheel?

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"    
           xmlns:mx="library://ns.adobe.com/flex/mx"     
           xmlns:s="library://ns.adobe.com/flex/spark"  height="100%" width="100%">

<s:Group>
    <s:List id="listy" width="50%" height="100">
        <mx:ArrayCollection>
            <fx:String>Flash</fx:String> 
            <fx:String>Director</fx:String> 
            <fx:String>Dreamweaver</fx:String> 
            <fx:String>ColdFusion</fx:String> 
            <fx:String>Flash</fx:String> 
            <fx:String>Director</fx:String> 
            <fx:String>Dreamweaver</fx:String> 
            <fx:String>ColdFusion</fx:String> 
            <fx:String>Flash</fx:String> 
            <fx:String>Director</fx:String> 
            <fx:String>Dreamweaver</fx:String> 
            <fx:String>ColdFusion</fx:String> 
        </mx:ArrayCollection>
    </s:List>

</s:Group>

like image 712
user_78361084 Avatar asked Sep 30 '11 01:09

user_78361084


3 Answers

I believe the way you'd want to do it to set a custom skin for the List, which then sets a custom skin for the Scroller component within it. In the Scroller skin, you could set the scrollbar as visible=false.

like image 85
J_A_X Avatar answered Oct 04 '22 21:10

J_A_X


Just type:

<s:Scroller id="myScroller" verticalScrollBar="{new VScrollBar()}">

This code solve my problem=)

like image 29
Ilyakom Avatar answered Oct 04 '22 21:10

Ilyakom


Ive been looking for a solution for this question , and I think it's a problem many people ancounter , so I decided to answer this question although its quite old.

The solution for your problem is real simple. You simply make a custom skin for the scroller and inside the scroller simply set the vertical scroller "alpha" property set to zero

<s:VScrollBar id="verticalScrollBar" visible="false" alpha="0"/>

Hope this will help someone

like image 40
user1108310 Avatar answered Oct 04 '22 20:10

user1108310