I always end up hard-coding things that appear to be so simple…
This is the scenario:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:Form>
<s:layout>
<s:TileLayout requestedColumnCount="2"
verticalAlign="middle" />
</s:layout>
<s:FormItem label="Label with long text">
<s:TextInput />
</s:FormItem>
<s:FormItem label="Label with long text">
<s:Label text="something" />
</s:FormItem>
<s:FormItem label="shortLabel">
<s:TextInput />
</s:FormItem>
<s:FormItem label="shortLabel">
<s:Label text="something" />
</s:FormItem>
</s:Form>
</s:Application>
Is there a simple way to give each tile layout column a FormLayout?
In form layout, all the first items on FormItem containers are aligned.
You have overridden form layout that’s why elements are not aligned correctly.
As I understand you need multi columns form. Flex doesn’t support such functionality now.
Possible solutions are:
1. Use 2 forms in container. In such case form items would be aligned.
2. Define form items sizes.
3. Write you own new multi column form layout and share it.