Search code examples
apache-flexflex4skinningflex-spark

How do I set the scroller to invisible in a mobile skin


... while still enabling it scroll?

I have a Spark List running in a mobile application. When I turn on horizontal scroll bars and then when I swipe as I use the application scroller bars fade in and then fade out. I would like them to always be invisible.


Solution

  • Inside your css file do this

    s|List s|HScrollBar {
        skinClass: ClassReference("ScrollBarSkin");
        fixedThumbSize:true;
    }
    s|List s|VScrollBar {
        skinClass: ClassReference("ScrollBarSkin");
        fixedThumbSize:true;
    } 
    

    create a class like this

    package 
    {
        import spark.components.HScrollBar;
        import spark.skins.mobile.HScrollBarSkin;
    
        public class ScrollBarSkin extends HScrollBarSkin
        {
            public function ScrollBarSkin()
            {
                super();
                alpha = 0.0;
                visible = false;
            }
    
        }
    }
    

    All your list scroll bar will be invisible, hope this will help