移动设备上的FormItem中的标签未正确对齐

时间:2012-11-19 07:14:28

标签: flex flex4 flex4.5 flex-spark flex4.6

FormItem在移动设备上无法正确对齐。有没有解决这个问题?

<s:Form width="100%" backgroundColor="#ff0000">
    <s:FormItem label="First Name" width="100%" >
        <s:TextInput id="firstName" width="100%" borderAlpha="0"  />
    </s:FormItem>

    <s:FormItem label="Last Name" width="100%" >
        <s:TextInput id="lastName" width="100%" borderAlpha="0"  />
    </s:FormItem>
</s:Form>

FormItem in mobile

注意:在HGroup上设置基线时,会发生相同的事情。

    <s:HGroup width="100%" verticalAlign="baseline">
        <s:Label text="First Name" />
        <s:TextInput id="a" width="100%" 
                     height="32"
                     minHeight="0"
                     paddingTop="0" paddingBottom="0" 
                     borderVisible="false"
                     contentBackgroundAlpha="0"
                     contentBackgroundColor="#00ff00"
                     focusAlpha="0"/>
    </s:HGroup>

HGroup aligned to baseline

1 个答案:

答案 0 :(得分:1)

将布局添加到表单,并将垂直对齐设置为中间:

<s:Form width="100%"
        backgroundColor="#ff0000">

    <s:layout>
        <s:VerticalLayout verticalAlign="middle" />
    </s:layout>

    <s:FormItem label="First Name"
                width="100%">
        <s:TextInput id="firstName"
                     width="100%"
                     borderAlpha="0" />
    </s:FormItem>

    <s:FormItem label="Last Name"
                width="100%">
        <s:TextInput id="lastName"
                     width="100%"
                     borderAlpha="0" />
    </s:FormItem>

</s:Form>
相关问题