The default behavior of scroll bars in a mobile Scroller is to always hide the scrollbars unless a touch scrolling operation is in effect. This post demonstrates how to customize this behavior so that the scroll bars are always visible. It also demonstrates how to have scrollbars automatically appear at startup then fade away after a short period of time.
The default behavior of a Scroller with interactionMode=”touch” is to hide the scroll bars except while a throw or drag scroll operation is in progress. There is currently no API to stop this auto hiding behavior. If you would like this behavior please vote for SDK-29296.
One way of getting the scroll bars to always be visible is to subclass VScrollBar/HScrollBar and override the setters for the alpha/visible/includeInLayout/scaleX/scaleY properties. Overriding alpha and visible might be obvious, but overriding includeInLayout/scaleX/scaleY can be a little confusing. This needs to be done because Scroller and ScrollerLayout operate on these properties while fading away the scroll bars.
Taking this idea a step further, we can now implement a behavior commonly seen on native iOS and Android applications: the scroll bars are shown initially at startup and then quickly fade away to signify that an area is scrollable. Flex doesn’t currently support this functionality (please vote for SDK-29299), but it can be accomplished by overriding the properties above and setting up an effect to animate the alpha after the scrollbars have been shown for a brief period of time.
Here is a sample Flex Mobile Project that demonstrates this code in action: AlwaysVisibleScrollbars.zip