A ViewStack navigator container is made up of a collection of child containers stacked on top of each other with only one container visible, or active, at a time. The ViewStack container does not define a built-in mechanism for users to switch the currently active container; you must use a LinkBar or TabBar navigator container or build the logic yourself in ActionScript to let users change the currently active child. For example, you can define a set of Button controls that switch among the child containers.
The following figure shows a representation of a ViewStack container:
The figure on the left shows a ViewStack container with the first child active. The index of a child in a ViewStack container is zero-based, 0, 1, 2, ... , n - 1, where n is the number of child containers. The figure on the right shows the ViewStack container with the second child container active.
A ViewStack container has the following default properties:
| Property | Default |
|---|---|
|
Preferred size |
The width and height of the currently active child. |
|
Container resizing rules |
ViewStack containers are only sized once to fit the size of the first child container by default. They do not resize when you navigate to other child containers by default. To force ViewStack containers to resize when you navigate to a different child container, set the You can ensure that all of your child containers fit in the ViewStack container with the expected layout by setting the |
|
Child sizing rules |
Children are sized to their preferred size. The child is clipped if it is larger than the ViewStack container. If the child is smaller than the ViewStack container, it is aligned to the upper-left corner of the ViewStack container. |
|
Default margins |
Top, bottom, left, right = 0 pixels. |
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/00000385.htm