R – Flex 3 scroll bars not added/enabled when they should be

apache-flexscrollbar

I'm currently learning Flex, and am having the hardest time getting scroll bars to work. In short, I'm making a giant form for users to fill out, contained within a viewstack component. The user will type up information in one view, and it will be displayed in the other. But right now in the first canvas I have components that run off the screen and flex doesn't automatically add a scroll bar, so I added 'verticalScrollPolicy="on"' to my canvas. Now, while it gives me a scroll bar, it gives me an empty scroll bar. I still cannot move it up or down, meaning components are still trapped off the bottom of my screen. Am I missing something simple?

Edit – I'm using Adobe Flex Builder 3, and the components it lets you drag in. http://img12.imageshack.us/img12/218/problem1f.jpg This is a picture of the problem, and i guess relavent code would be.

 <mx:Application xmlns:mx="adobe.com/2006/mxml" layout="absolute" width="830" height="835"> 
<mx:ViewStack x="10" y="72" id="viewstack1" width="790" height="751" >

<mx:Canvas label="Design Mode" width="100%" height="100%" verticalScrollPolicy="on" horizontalScrollPolicy="on" > 
(Components inside)
</mx:Canvas> 

Best Answer

I think the problem is in the way the content in your canvas determines it's height.

If I do this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:ViewStack width="500" height="500">
        <mx:Canvas width="100%" height="100%">
            <mx:Canvas width="100" height="1000" backgroundColor="#ededed" />
        </mx:Canvas>
    </mx:ViewStack>
</mx:Application>

I get scrollbars - Canvas has a default horizontalScrollPolicy and verticalScrollPolicy of auto, meaning it'll show the scrollbars as needed. I think, for whatever reason, the outer canvas isn't detecting that the content is taller than it should be.

Related Topic