我嘗試瞭解gridlayout的工作方式,結果我非常失望。爲什麼我的網格佈局太奇怪了
確實,我的佈局不適用寬度GridItem。
對於每個MX:GridRow,總的GridItem是列跨度6.
起初GridRow,我定義,以百分比寬度,但可以看到,具有的GridItem不即使寬度和列跨度數是相同的尺寸一樣!
主要問題是在GridRow 1和GridRow 2上,兩個dropdowlist都太大!
<s:VGroup id="mainContainer" width="{contentGroup.width}" height="{contentGroup.height}" >
<!-- partie centrale-->
<s:VGroup height="100%" width="100%">
<s:BorderContainer width="100%" verticalCenter="0">
<mx:Grid width="100%" height="100%"
paddingBottom="5" paddingTop="5" paddingLeft="5" paddingRight="5">
<mx:GridRow id="l1" width="100%">
<mx:GridItem colSpan="1" width="15%" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="2" width="35%" horizontalAlign="left">
<s:DropDownList id="cbCivilCor" width="100%"
prompt="" />
</mx:GridItem>
<mx:GridItem colSpan="1" width="15%" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left" width="35%">
<s:DropDownList id="cbSpecCor" width="100%"
prompt=""/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l2" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left" >
<s:TextInput id="tiNom" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="left">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left" width="100%">
<s:TextInput id="tiPrenom" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l3" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="4" horizontalAlign="left" width="100%">
<s:TextInput id="tiAdr1" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l4" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
</mx:GridItem>
<mx:GridItem colSpan="4" horizontalAlign="left">
<s:TextInput id="tiAdr2" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l5" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:TextInput id="tiCP" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left">
<s:TextInput id="tiVille" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l6" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:DropDownList id="cbTypeTel1"
prompt="" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:TextInput id="tiNumTel1" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left">
<s:TextInput id="tiRemTel1" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l7" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:DropDownList id="cbTypeTel2"
prompt="" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:TextInput id="tiNumTel2" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left">
<s:TextInput id="tiRemTel2" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l8" width="100%">
<mx:GridItem colSpan="1" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:TextInput id="tiFax" width="100%"/>
</mx:GridItem>
<mx:GridItem colSpan="1" horizontalAlign="left">
<s:Label text="Label" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="2" horizontalAlign="left">
<s:TextInput id="tiMail" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l9" width="100%">
<mx:GridItem colSpan="3" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label tres long" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="3" horizontalAlign="left">
<s:DropDownList id="cbAppelCourr"
prompt="" width="100%"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow id="l10" width="100%">
<mx:GridItem colSpan="3" verticalAlign="middle" horizontalAlign="right">
<s:Label text="Label tres long" width="100%" horizontalCenter="0" textAlign="right"/>
</mx:GridItem>
<mx:GridItem colSpan="3" horizontalAlign="left">
<s:DropDownList id="cbPoliCourr"
prompt="" width="100%"/>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</s:BorderContainer>
<customNavTab:IconToggleButtonBar id="tbbAction" height="6%"
dataProvider="{buttons}"
itemClick="changeBbHandler(event)" labelPlacement="bottom"
paddingBottom="2" selectedIndex="-1" toggleOnClick="false"
horizontalAlign="center"
bottom="3"
width="100%"/>
</s:VGroup>
</s:VGroup>
所以,能不能請你爲什麼佈局不按我的希望解釋一下!
謝謝。
謝謝,你的方法運作良好。 – Flex60460