This article focuses on Flex layout rules, including eight layout rules, such as VBox layout, HBox layout, and Canvas layout, you have a deep understanding of Flex layout rules.
Flex layout rules
1) VBox
Child elements are arranged vertically. Each child element is drawn below the previous label.
(2) HBox
Child elements are arranged horizontally. Each child element is drawn on the right of the previous label.
(3) Canvas
In the Flex layout rule, child elements are drawn based on the x and y coordinates specified by the developer. If no coordinates are specified, all child elements are drawn in the upper left corner of the container. For example, if you add a Button control to the Canvas container and do not specify the x and y coordinates for the Button control, the Button will be displayed in the upper left corner of the Canvas, in the default) location.
(4) Application
By using the Layout attribute, the Application Layout can be set to any method similar to that in a VBox, HBox, or Canvas container.
(5) Tile
Arrange its child elements into one or more vertical or horizontal columns, and add new rows or columns as needed. All Tile containers have the same cell size. Flex arranges the cells of the Tile container in a square grid, and each cell is placed into a child element. The Layout mode is determined by the direction attribute.
(6) Panel
The subclass of the Box container in the Flex layout rule. The Panel container can be laid out like any of the VBox, HBox, or Canvas containers, this depends on the default use of Layout = "absolute" for the specified layout attribute. The Layout behavior is the same as that of the Canvas container ). In addition to sub-elements, the Panel container also dreams of the title bar area, which can contain its title and status information.
(7) ControlBar
The ControlBar container can be used to dock the toolbar at the bottom of the Panel container or TitleWindow container. The ControlBar container can be deployed as an HBox container or VBox container, depending on the default value of the direction attribute is horizontal)
(8) ApplicationControlBar
The ApplicationControlBar container is used to place components that are accessible throughout the application. If the ApplicationControlBar container is the first child element of the <mx: Application> label and the dock attribute is true, the just-ApplicationControlBar container will be docked at the top of the Application drawing area, the maximum width of the application, and cannot scroll with the application. The ApplicationControlBar container can be deployed as an HBox container or VBox container, depending on the default value of the direction attribute is horizontal)