0
以前(Flex 3.5),我使用過HBox幷包含了TextInput框。在Flex 4.x中,必須使用BorderContainers;但是當我使用addElement或addChild函數時,孩子不會出現。如何在Flex 4.x中使用AS來完成任務?如何在邊界容納包含AS的兒童容器
//Flex 3.5
var twpBox:HBox = new HBox();
twpBox.id = "twp";
var ti1:TextInput = new TextInput();
ti1.id = "section";
var ti2:TextInput = new TextInput();
ti2.id = "township";
twpBox.addChild(ti1);
twpBox.addChild(ti2);
//Flex 4.x
var bcTest:BorderContainer = new BorderContainer();
var cmdOK:Button = new Button();
bcTest.addElement(cmdOK);
+1指出HGroup作爲HBox的替代品。這些項目沒有出現的一個可能原因可能是OP沒有確定它們的大小。或者,如果他使用BorderContainer而不指定基本以外的佈局,它們可以堆疊在彼此之上;從而導致其中一些不顯示。 – JeffryHouser