views:

27

answers:

1

A sample app where the scroller does not show up. Is there any sane way of using a scroller in a constrain based layout?

<?xml version="1.0" encoding="utf-8"?>

<s:HGroup left="0" right="0" top="0" bottom="0">                
        <s:Scroller left="0" right="0" top="0" bottom="0">
            <s:VGroup>        
                <s:BorderContainer borderColor="0" width="500" height="500"/>
                <s:BorderContainer borderColor="0" width="500" height="500"/>
                <s:BorderContainer borderColor="0" width="500" height="500"/>
            </s:VGroup>
        </s:Scroller>    
</s:HGroup>

A: 

Found the solution after "brute forcing" every possible combination of left/right/widt/height etc

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       width="500" height="400"
                       >
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

       <s:HGroup left="0" right="0" top="0" bottom="0" >
        <s:Scroller width="100%" height="100%">
            <s:VGroup >        
                <s:BorderContainer borderColor="0" width="500" height="500"/>
                <s:BorderContainer borderColor="0" width="500" height="500"/>
                <s:BorderContainer borderColor="0" width="500" height="500"/>
            </s:VGroup>
        </s:Scroller>  
         </s:HGroup>

</s:WindowedApplication>
nizzle