MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guía de usuario Pagina 122

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 256
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 121
122 Create a Constraint-based Layout
Learn about constraint-based layouts
in Flex
When a user resizes a Flex application window, you want the components in your layout to
adjust automatically. A constraint-based layout adjusts the size and position of components
when the user resizes the application window.
To create a constraint-based layout, you must use a container with a
layout property set to
absolute (
layout="absolute"). This property gives you the flexibility of positioning and
sizing components with absolute positioning while also providing you with the ability to set
constraints that stretch and move the components when the container is resized.
For example, if you want a TextInput text box to stretch when the user makes the application
window wider, you can anchor the control to the left and right edges of the container so that
the width of the text box is set by the width of the window.
In Flex, all constraints are set relative to the edges of the container. They cannot be set relative
to other controls.
Now that you understand the basic concepts, you can create a simple layout and define layout
constraints for it in Flex Builder.
Insert and position the components
The first step in creating a constraint-based layout is to position the components in a
container with a
layout property set to absolute. This property allows you to drag and
position components anywhere in the container. For pixel-point accuracy, you can set x and y
coordinates.
In this section, you insert and position the controls of a simple feedback form.
1. With your Lessons project selected in the Navigator view, select File > New > MXML
Application and create an application file called Layout.mxml.
By default, Flex Builder includes the
layout="absolute" property in the Application
tag.
NOTE
The Canvas container does not require the layout="absolute" property because its
layout is absolute by default.
NOTE
For the purpose of these short tutorials, several application files are used in a single
Flex Builder project. However, its good practice to have only one MXML application
file per project.
Vista de pagina 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 255 256

Comentarios a estos manuales

Sin comentarios