I have been stuck on this for far too long. I think it’s simple so I must be misunderstanding something. Any help/pointers is appreciated.
I have a spark form components laid out like
label1: textbox1
label2: textbox2
label3: textbox3 etc
I want these to display across the full width of my flash app. When I shrink the width of the flash player I want a scrollbar to appear. At the moment no scroll bar is appearing.
My code is:
<s:layout>
<s:VerticalLayout horizontalAlign="left" paddingTop="10" paddingBottom="10"/>
</s:layout>
<s:BorderContainer borderVisible="false">
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:Form id="custAccountForm" height="100%">
<s:layout>
<s:FormLayout gap="-10" paddingLeft="-15" paddingRight="-45"/>
</s:layout>
<s:FormHeading label="Customer/Account Details"/>
<s:FormItem label="CustomerName">
<s:TextInput width="100%"/>
</s:FormItem>
<s:FormItem label="Account">
<s:TextInput width="100%"/>
</s:FormItem>
<s:FormItem label="Currency">
<s:ComboBox id="currencyCB" width="100%"/>
</s:FormItem>
<s:FormItem label="Account Balance">
<s:TextInput width="100%" maxChars="24"/>
</s:FormItem>
</s:Form>
</s:BorderContainer>
How do I get a vertical/horizontal scroll bar on this to only appear when the application is smaller that the form.
Thanks
You need to add a scroller. The Flex 4.0 Spark Architecture does not bake scroll bars into the containers like they did with the Halo/MX style controls. Conceptually you may do something like this:
In my usage I find that the Scroller works best if given an explicit height and width; and if given percentage height and widths will size to it’s content–meaning you have no scroll bars. If you need to hanle he browser changing size; you’ll have to change the scroller’s height and width when the container changes. Possibly using updateDisplayList() to resize.