Question

I have MXML s:View component that consists of action bar and 3 custom components that are 100% application width. I added a scroller like so:

 section = new VGroup();
 var scroller:Scroller = new Scroller();
 scroller.percentHeight = 100;
 scroller.viewport = section;

What happens is that I get both vertical and horizontal scroll bars. I want to remove the horizontal scrollbar. The horizontal scrollbar appears to be barely wider than the width of the application. As far as I see my content does not exceed application width.

How can I get rid of the horizontal scroll bar?

Was it helpful?

Solution

All you should have to do is set the horizontalScrollPolicy style to ScrollPolicy.OFF:

In Actionscript, you set styles using the setStyle() method:

section = new VGroup();
var scroller:Scroller = new Scroller();
scroller.percentHeight = 100;
scroller.viewport = section;
scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);

In MXML, you just pass in a string that the ScrollPolicy class defines:

<s:Scroller horizontalScrollPolicy="off">
    <s:VGroup>
    </s:VGroup>
</s:Scroller>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top