Controlling component sizing and positioning in a container

A container controls the layout of its children using a well-defined set of rules. The layout rules are a combination of the rules for the children and the rules of the parent container. Layout rules mean that you do not have to worry about positioning container children. Instead, you concentrate on building the logic of your application and let Flex control the layout.

Each container has its own rules for controlling layout. For example, the VBox container lays out its children in a single column. A Grid container lays out its children in rows and columns of cells.

Although containers have built-in layout rules, each container also has properties that you use to configure aspects of layout. For example, you can use the verticalGap and horizontalGap properties of a Tile container to set the spacing between children, and the direction property to specify either a row or column layout.

If you require total control over the sizing and positioning of container children, use the Canvas container. The Canvas container does not have any predefined layout rules. Instead, you explicitly set the position of its children using the x and y properties of each child, and set the size using the height and width properties of each child.


Version 1.5

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00000290.htm