flex4(flex skd4)的布局发生了很大变化,在flex3中有vbox或hbox等,在flex4中使用 layout 中的 VerticalLayout 或 HorizontalLayout 设置,并且外部要包group。
代码:两个group
<s:Panel x="40" y="18" width="321" height="260"> <s:Scroller width="100%" height="100%"> <s:Group x="10" y="12" width="100%" height="100%" id="group1"> <s:layout> <s:VerticalLayout useVirtualLayout="true"/> </s:layout> <s:TextInput/> <s:Button label="按钮"/> <s:Group width="200" height="200" x="170" y="111"> <s:layout> <s:HorizontalLayout useVirtualLayout="true"/> </s:layout> <s:Button label="按钮"/> <mx:DateChooser width="149" height="172"/> </s:Group> </s:Group> </s:Scroller> </s:Panel>
效果: