views:

19

answers:

1

I usually set the layout like this

<s:Group>
   <s:layout>
      <s:VerticalLayout gap="10"/>
   </s:layout>
</s:Group>

but not sure how to specify the gap if I want to use new VerticalLayout

A: 

The VerticalLayout constructor does not have any parameters, so you won't be able to do this in-line in MXML as part of the layout property. You'll have to set the gap property on the layout after creating it. Perhaps in a creationComplete handler, do something like this:

groupID.layout.gap = 10;

You can probably even do this in-line:

<s:Group layout="{new VerticalLayout()}" id="groupID" creationComplete="{groupID.layout.gap = 10}"></s:Group>
www.Flextras.com