1

这是场景:

<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" minWidth="955" minHeight="600">
    <s:HGroup>
        <s:Form>
            <s:FormItem label="label1">
                <s:TextInput/>
            </s:FormItem>
            <s:FormItem label="label2">
                <s:TextInput/>
            </s:FormItem>
            <s:FormItem label="label3">
                <s:TextInput/>
            </s:FormItem>
        </s:Form>
        <s:Form>
            <s:FormItem label="label1">
                <s:Label text="soemthing"/>
            </s:FormItem>
            <s:FormItem label="label2">
                <s:Label text="soemthing"/>
            </s:FormItem>
            <s:FormItem label="label3">
                <s:Label text="soemthing"/>
            </s:FormItem>
        </s:Form>
    </s:HGroup>
</s:Application>

问题是,将左侧表单的每个 formItem 与右侧表单中的每个 formItem 对齐的正确方法是什么?

4

1 回答 1

3

用于TileLayout您的表格:

平铺布局

<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="label1">
            <s:TextInput />
        </s:FormItem>
        <s:FormItem label="label1">
            <s:Label text="something" />
        </s:FormItem>

        <s:FormItem label="label2">
            <s:TextInput />
        </s:FormItem>
        <s:FormItem label="label2">
            <s:Label text="something" />
        </s:FormItem>

        <s:FormItem label="label3">
            <s:TextInput />
        </s:FormItem>
        <s:FormItem label="label3">
            <s:Label text="something" />
        </s:FormItem>

    </s:Form>

</s:Application>
于 2012-10-26T18:12:53.827 回答