
Example 4-5
is some sample code for an absolutely positioned
layout.
Example 4-5. An absolutely positioned layout
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" backgroundColor="#FFFFFF"
backgroundAlpha="0">
<mx:Canvas x="23" y="34">
<mx:Button label="< prev" x="4" y="97" />
<mx:Image source="assets/animals03.jpg" x="85" y="4" />
<mx:Label text="Photographed by Elsie Weil" x="85"
y="230" />
<mx:Button label="next >" x="381" y="97" />
</mx:Canvas>
</mx:Application>
Figure 4-5 shows the result.
The Canvas Container (Relative Positioning)
With relative positioning, also called constraint-based layout,
you can anchor the sides or center of a component to positions
which are relative to the component’s container. The size and
position of the components change when the user resizes the
Figure 4-4. A combination VBox and HBox layout
42 | Chapter 4: Flex Controls and Layout
Komentáře k této Příručce