MACROMEDIA FLEX-GETTING STARTED WITH FLEX Uživatelský manuál Strana 59

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 148
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 58
application window. The container’s layout
property must be
set to absolute. All constraints are set relative to the edges of
the container, not to other controls in the container. The left,
right, top, bottom, horizontalCenter, and verticalCenter
properties are anchors in constraint-based layouts.
Example 4-6 shows the code for positioning children in a con-
straint-based layout using the top, bottom, left, right, horizon
talCenter, and verticalCenter styles.
Example 4-6. Photo.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute backgroundColor="#FFFFFF"
backgroundAlpha="0">
<mx:HDividedBox width="100%" height="300">
<mx:Canvas backgroundColor="#FFFFCC" width="150"
height="100%">
<mx:Label text="Adjust this section" left="15" />
</mx:Canvas>
<mx:Canvas>
<mx:Button label="&lt; prev" left="10" top="120"/>
<mx:Image source="animals03.jpg" horizontalCenter="0"
top="30"/>
<mx:Label text="Photographed by Elsie Weil"
horizontalCenter="0" top="250"/>
<mx:Button label="next &gt;" right="10" top="120"/>
Figure 4-5. An absolutely positioned image
The Canvas Container (Relative Positioning) | 43
Zobrazit stránku 58
1 2 ... 54 55 56 57 58 59 60 61 62 63 64 ... 147 148

Komentáře k této Příručce

Žádné komentáře