Package | spark.layouts |
Class | public class BasicLayout |
Inheritance | BasicLayout LayoutBase OnDemandEventDispatcher Object |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 4 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
left
, right
,
top
, bottom
, horizontalCenter
,
verticalCenter
, baseline
, percentWidth
, and percentHeight
.
Element's minimum and maximum sizes will always be respected.
The measured size of the container is calculated from the elements, their constraints and their preferred sizes. The measured size of the container is big enough to fit in all of the elements at their preferred sizes with their constraints satisfied.
Here are some examples of how measured size is calculated:
left
constraint specified,
then the container's measured width will be equal to the element's preferred
width plus the value of the left
constraint.percentWidth
specified,
then the container's measured width will be equal to the element's preferred width.
Even though the element's percentWidth
is not directly factored in the calculations,
it will be respected during a call to the updateDisplayList()
method.baseline
constraint specified,
then the container's measured height will be equal to the element's preferred height
plus the baseline
and minus the value of the element's baselinePosition
property.verticalCenter
constraint specified,
then the container's measured height will be equal to the element's preferred height
plus double the value of the verticalCenter
constraint.During a call to the updateDisplayList()
method,
the element's size is determined according to
the rules in the following order of precedence (the element's minimum and
maximum sizes are always respected):
percentWidth
or percentHeight
set,
then its size is calculated as a percentage of the available size, where the available
size is the container size minus any left
, right
,
top
, or bottom
constraints.left
and right
constraints.top
and bottom
constraints,
it's height is set to be the container's height minus the top
and bottom
constraints.The element's position is determined according to the rules in the following order of precedence:
horizontalCenter
or verticalCenter
constraints
specify the distance between the container's center and the element's center.
Set the horizontalCenter
or verticalCenter
constraints
to zero to center the element within the container in
the horizontal or vertical direction.baselinePosition
(usually the base line
of its first line of text) is aligned with baseline
constraint.top
or left
constraints
are specified, then the element is
positioned such that the top-left corner of the element's layout bounds is
offset from the top-left corner of the container by the specified values.bottom
or right
constraints are specified,
then the element is positioned such that the bottom-right corner
of the element's layout bounds is
offset from the bottom-right corner of the container by the specified values.The content size of the container is calculated as the maximum of the coordinates of the bottom-right corner of all the layout elements.
MXML SyntaxHide MXML SyntaxThe <s:BasicLayout>
tag inherits all of the tag
attributes of its superclass and adds no additional tag attributes:
<s:BasicLayout/>
Method | Defined By | ||
---|---|---|---|
Constructor. | BasicLayout | ||
OnDemandEventDispatcher | |||
When useVirtualLayout is true,
this method can be used by the layout target
to clear cached layout information when the target changes. | LayoutBase | ||
OnDemandEventDispatcher | |||
Called by the target after a layout element
has been added and before the target's size and display list are
validated. | LayoutBase | ||
This method must is called by the target after a layout element
has been removed and before the target's size and display list are
validated. | LayoutBase | ||
Returns the change to the horizontal scroll position to handle
different scrolling options. | LayoutBase | ||
getNavigationDestinationIndex(currentIndex:int, navigationUnit:uint, arrowKeysWrapFocus:Boolean):int
Delegation method that determines which item
to navigate to based on the current item in focus
and user input in terms of NavigationUnit. | LayoutBase | ||
Computes the verticalScrollPosition and
horizontalScrollPosition deltas needed to
scroll the element at the specified index into view. | LayoutBase | ||
Returns the change to the horizontal scroll position to handle
different scrolling options. | LayoutBase | ||
OnDemandEventDispatcher | |||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Measures the target's default size based on its content, and optionally
measures the target's default minimum size. | LayoutBase | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
OnDemandEventDispatcher | |||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Sizes and positions the target's elements. | LayoutBase | ||
Called by the target at the end of its updateDisplayList
to have the layout update its scrollRect. | LayoutBase | ||
Returns the primitive value of the specified object. | Object | ||
OnDemandEventDispatcher |