Flex表单:将标签对齐,右对齐 [英] Flex Forms: getting labels to line up, right-justified

查看:682
本文介绍了Flex表单:将标签对齐,右对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是默认的行为(所有的Adobe文件似乎表明,这是事实)。
假设您有一个表格:
名称:[ _ __ ]
密码:[一般来说,你希望名称和密码排列在一起。 ____ 在右边(右对齐)。这个长度应该是最长标签的长度。当我将下面的代码添加到我的MXML(在Flex 4中创作)时,它根本就没有这样做!但是相反,所有的东西都是左对齐的,类似于上面的Name / Password例子。

解决方案是什么?

 < s:Form id =directoryForm_Awidth =100%> 
< s:layout>
< / s:layout>
< s:FormItem label =Click>
< s:Button label =Button/>
< / s:FormItem>
< s:FormItem label =根目录>
< / s:FormItem>
< / s:表格>


解决方案

您正在阅读哪些Adobe文档?你意识到Spark Form将和Halo / MX Form非常不同。我也怀疑Spark表单还没有工作。



以下是 Spark Form。



我想你会从阅读 FormItemLayout详细信息。我找不到要求所有标签对齐的文档。

I thought this was the default behaviour (all the Adobe docs seem to indicate that this is the case). Say you have a form: Name: [______] Password: [________]

generally you want Name and Password to line up on their right-hand side (right justification). The length should be the length of the longest label.

When I add the following code to my MXML (authoring in Flex 4) it does not do that at all! But rather tjust crams everything left-justified, similar to the Name/Password example above.

What's the solution?

<s:Form id="directoryForm_A" width="100%">                      
    <s:layout>
        <s:VerticalLayout horizontalAlign="justify"/>
    </s:layout>
    <s:FormItem label="Click">
        <s:Button label="Button"/>
    </s:FormItem>
    <s:FormItem label="Root Directory">
        <s:TextInput x="0" width="100%" enter="handleUserSetRootDirectory(event)"/>
    </s:FormItem>
</s:Form>

解决方案

Which Adobe docs were you reading? You realize that the Spark Form are going to be very different than the Halo / MX Form. I would also suspect that the Spark form is not working yet.

Here are the docs on the Spark Form.

I think you'll benefit from reading the layout rules section of the FormItemLayout details. I cannot find the documentation that claims that all labels will be right aligned.

这篇关于Flex表单:将标签对齐,右对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆