简体   繁体   English

Flex表格:如何根据内容自动更改表格宽度

[英]Flex form : how to change the width of form automatically according to the content

I am creating a flex form whose code is as follows:- 我正在创建一个Flex表单,其代码如下:-
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:Form>
<s:layout>
<s:FormLayout gap="5"/>
</s:layout>
<s:FormItem label="First Name : ">
<s:TextInput id="fn" />
</s:FormItem>
<s:FormItem label="Last Name : ">
<s:TextInput id="ln" />
</s:FormItem>
<s:FormItem label="Email Address :">
<s:TextInput id="ea"/>
</s:FormItem>
<s:FormItem label="Re-enter Email Address :">
<s:TextInput id="rea"/>
</s:FormItem>
<s:FormItem label="Password :">
<s:TextInput id="pw" displayAsPassword="true" />
</s:FormItem>
<s:FormItem label="Re Enter Password :">
<s:TextInput id="rpw" displayAsPassword="true" />
</s:FormItem>
<s:FormItem label="Security Question">
<s:DropDownList>
<s:ArrayList>
<fx:String>Mother's maiden name?</fx:String>
<fx:String>Birthplace?</fx:String>
<fx:String>Pet's name?</fx:String>
<fx:String>Favourite destination</fx:String>
</s:ArrayList>
</s:DropDownList>
</s:FormItem>
<s:FormItem>
<s:Button label="Submit" click="abc()" />
</s:FormItem>
</s:form>

Now here i have a problem that is, how to increase the width of dropdownmenu so that it looks great. 现在我这里有一个问题,就是如何增加dropdownmenu的宽度,使其看起来很棒。 How to make the width change based on the content? 如何根据内容更改宽度?

You can try either 您可以尝试

<Component width="100%" />

or 要么

<Component left="0" right="0" />

It depends on your purposes, 这要看你的目的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM