s:Group arrange component on the same center
I use a s:Group to place my component in my form. I'd like all form item have the same horizontal align inside the group. I try to use horizontalcenter with value 0 but it doesn't work. So I don't know how to do and I hope you can help me to solve that.
<s:Group width="100%" resizeMode="noScale" verticalCenter="0" horizontalCenter="0">
<s:FormItem label="Naissance" tabIndex="5" x="{cbQualite.x}" id="fiNaissance">
<mx:DateField id="dfNaissance" width="100" editable="true"
formatString="DD/MM/YYYY" yearNavigationEnabled="true"
/>
</s:FormItem>
<s:RadioButton id="rbFem" label="Féminin" group="{rbsex}" tabIndex="7"
x="{fiNaissance.x + fiNaissance.width+5}"
/>
<s:RadioButton id="rbMas" label="Masculin" group="{rbsex}" tabIndex=开发者_如何学Go"6" x="{rbFem.width + rbFem.x + 5}" y="{fiNaissance.y +(fiNaissance.height)/2}"/>
<s:DropDownList id="cbDossier2" dataProvider="{DP_PAT_DOS1}" width="118" height="22" tabIndex="8" x="{cbDossier1.x}"/>
<s:FormItem label="" tabIndex="9" x="{fiDossier1.x}" >
<s:TextInput id="fDossier2" width="90" paddingRight="5" text="@{objectPatient.paDossier2}" />
</s:FormItem>
</s:Group>
What do you mean by same horizontal align ?
If you want elements inside Group to be centered horizontally you must put horizontalCenter="0" not on the parent but on each child.
Furthermore it is a mistake to specify width="100%" and horizontalCenter="0" both on Group. width="100%" indicates your Group will take all horizontal space in the parent container if the parent container layout support it. Your Group will automatically be centered.
Put all parts of the forms inside FormItems, and put all the FormItems inside a Form.
精彩评论