Package | spark.layouts |
Class | public class StackLayout |
Inheritance | StackLayout NavigatorLayoutBase LayoutBase OnDemandEventDispatcher Object |
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
This class is experimental, which means it has not been tested or documented as thoroughly as other core Apache Flex classes. |
The horizontal position of the shown element is determined by the layout's
horizontalAlign
property.
The vertical position of the shown element is determined by the layout's
verticalAlign
property.
The width of each element is calculated according to the following rules, listed in their respective order of precedence (element's minimum width and maximum width are always respected):
horizontalAlign
is "justify"
,
then set the element's width to the container width.horizontalAlign
is "contentJustify"
,
then set the element's width to the maximum between the container's width
and all elements' preferred width.percentWidth
is set, then calculate the element's
width as a percentage of the container's width.The height of each element is calculated according to the following rules, listed in their respective order of precedence (element's minimum height and maximum height are always respected):
verticalAlign
property is "justify"
,
then set the element's height to the container height.verticalAlign
property is "contentJustify"
,
then set the element's height to the maximum between the container's height
and all elements' preferred height.percentHeight
property is set,
then calculate the element's height as a percentage of the container's height.The <st:StackLayout>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<st:StackLayout Properties horizontalAlign="center|contentJustify|justify|left|right" verticalAlign="contentJustify|bottom|justify|middle|top" />
Property | Defined By | ||
---|---|---|---|
clipAndEnableScrolling : Boolean
If true, specifies to clip the children to the boundaries of the viewport. | LayoutBase | ||
dropIndicator : DisplayObject
The DisplayObject that this layout uses for
the drop indicator during a drag-and-drop operation. | LayoutBase | ||
elements : Vector.<IVisualElement> [read-only] | NavigatorLayoutBase | ||
firstIndexInView : int [read-only]
firstIndexInView
| NavigatorLayoutBase | ||
horizontalAlign : String
The horizontal alignment of layout elements. | StackLayout | ||
horizontalScrollPosition : Number
The x coordinate of the origin of the viewport in the component's coordinate system,
where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase | ||
indicesInLayout : Vector.<int> [read-only]
A convenience method for determining the elements included in the layout. | NavigatorLayoutBase | ||
indicesNotInLayout : Vector.<int> [read-only]
A convenience method for determining the elements excluded from the layout. | NavigatorLayoutBase | ||
lastIndexInView : int [read-only]
lastIndexInView
| NavigatorLayoutBase | ||
numElementsInLayout : int [read-only]
Returns an int specifying number of elements included in the layout. | NavigatorLayoutBase | ||
numElementsNotInLayout : int [read-only]
Returns an int specifying number of elements not included in the layout. | NavigatorLayoutBase | ||
numIndicesInView : int [read-only]
inheritDoc
| NavigatorLayoutBase | ||
renderingData : Boolean [read-only]
inheritDoc
| NavigatorLayoutBase | ||
scrollBarDirection : String
The direction of the ScrollBar to use for navigation. | NavigatorLayoutBase | ||
selectedElement : IVisualElement [read-only]
| NavigatorLayoutBase | ||
selectedIndex : int
The index of the selected INavigatorLayout item. | NavigatorLayoutBase | ||
sizeChangedInLayoutPass : Boolean [read-only] | NavigatorLayoutBase | ||
target : GroupBase [override]
The GroupBase container whose elements are measured, sized and positioned
by this layout. | NavigatorLayoutBase | ||
typicalLayoutElement : ILayoutElement
Used by layouts when fixed row/column sizes are requested but
a specific size isn't specified. | LayoutBase | ||
unscaledHeight : Number [read-only]
A convenience method for determining the unscaled height of the viewport. | NavigatorLayoutBase | ||
unscaledWidth : Number [read-only]
A convenience method for determining the unscaled width of the viewport. | NavigatorLayoutBase | ||
useScrollBarForNavigation : Boolean
useScrollBarForNavigation
| NavigatorLayoutBase | ||
useVirtualLayout : Boolean
A container can hold any number of children. | LayoutBase | ||
verticalAlign : String
The vertical alignment of layout elements. | StackLayout | ||
verticalScrollPosition : Number
The y coordinate of the origin of the viewport in the component's coordinate system,
where the default value is (0,0) corresponding to the upper-left corner of the component. | LayoutBase |
Method | Defined By | ||
---|---|---|---|
Constructor. | StackLayout | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void | OnDemandEventDispatcher | ||
Calculates the drop location in the data provider of the drop target for
the specified dragEvent. | LayoutBase | ||
clearVirtualLayoutCache():void
When useVirtualLayout is true,
this method can be used by the layout target
to clear cached layout information when the target changes. | LayoutBase | ||
dispatchEvent(event:Event):Boolean | OnDemandEventDispatcher | ||
elementAdded(index:int):void
Called by the target after a layout element
has been added and before the target's size and display list are
validated. | LayoutBase | ||
elementRemoved(index:int):void
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 | ||
getElementBounds(index:int):Rectangle
Returns the specified element's layout bounds as a Rectangle or null
if the index is invalid, the corresponding element is null,
includeInLayout=false,
or if this layout's target property is null. | LayoutBase | ||
getHorizontalScrollPositionDelta(navigationUnit:uint):Number [override] | NavigatorLayoutBase | ||
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 | ||
getScrollPositionDeltaToElement(index:int):Point
Computes the verticalScrollPosition and
horizontalScrollPosition deltas needed to
scroll the element at the specified index into view. | LayoutBase | ||
getVerticalScrollPositionDelta(navigationUnit:uint):Number [override] | NavigatorLayoutBase | ||
hasEventListener(type:String):Boolean | OnDemandEventDispatcher | ||
hideDropIndicator():void
Hides the previously shown drop indicator,
created by the showDropIndicator() method,
removes it from the display list and also stops the drag scrolling. | LayoutBase | ||
invalidateTargetSize():void | NavigatorLayoutBase | ||
measure():void [override] | NavigatorLayoutBase | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void | OnDemandEventDispatcher | ||
showDropIndicator(dropLocation:DropLocation):void
Sizes, positions and parents the drop indicator based on the specified
drop location. | LayoutBase | ||
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void [override]
Sizes and positions the target's elements. | NavigatorLayoutBase | ||
updateScrollRect(w:Number, h:Number):void [override] | NavigatorLayoutBase | ||
willTrigger(type:String):Boolean | OnDemandEventDispatcher |
Method | Defined By | ||
---|---|---|---|
applyColorTransformToElement(element:IVisualElement, colorTransform:ColorTransform):void | NavigatorLayoutBase | ||
calculateDragScrollDelta(dropLocation:DropLocation, elapsedTime:Number):Point
Calculates how much to scroll for the specified dropLocation
during a drag and drop gesture. | LayoutBase | ||
calculateDropIndex(x:Number, y:Number):int
Returns the index where a new item should be inserted if
the user releases the mouse at the specified coordinates
while completing a drag and drop gesture. | LayoutBase | ||
calculateDropIndicatorBounds(dropLocation:DropLocation):Rectangle
Calculates the bounds for the drop indicator that provides visual feedback
to the user of where the items will be inserted at the end of a drag and drop
gesture. | LayoutBase | ||
getElementBoundsAboveScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is above the scrollRect's top edge. | LayoutBase | ||
getElementBoundsBelowScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is below the scrollRect's bottom edge. | LayoutBase | ||
getElementBoundsLeftOfScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is to the left of the scrollRect's left edge. | LayoutBase | ||
getElementBoundsRightOfScrollRect(scrollRect:Rectangle):Rectangle
Returns the bounds of the first layout element that either spans or
is to the right of the scrollRect's right edge. | LayoutBase | ||
getElementLayoutBoundsHeight(element:IVisualElement, postLayoutTransform:Boolean = true):Number | NavigatorLayoutBase | ||
getElementLayoutBoundsWidth(element:IVisualElement, postLayoutTransform:Boolean = true):Number | NavigatorLayoutBase | ||
Returns a reference to the views Scroller if there is one. | NavigatorLayoutBase | ||
getScrollRect():Rectangle
Returns the bounds of the target's scroll rectangle in layout coordinates. | LayoutBase | ||
indicesInView(firstIndexinView:int, numIndicesInView:int):void | NavigatorLayoutBase | ||
invalidateSelectedIndex(index:int, offset:Number):void | NavigatorLayoutBase | ||
invalidateTargetDisplayList():void | NavigatorLayoutBase | ||
restoreElement(element:IVisualElement):void [override]
Restores the element to reset any changes to is visible properties. | StackLayout | ||
scrollPositionChanged():void [override] | NavigatorLayoutBase | ||
setElementLayoutBoundsSize(element:IVisualElement, postLayoutTransform:Boolean = true):void | NavigatorLayoutBase | ||
updateDisplayListBetween():void | NavigatorLayoutBase | ||
updateElements():void | NavigatorLayoutBase | ||
updateElementsInLayout():void | NavigatorLayoutBase | ||
updateScrollBar(index:int, offset:Number):void | NavigatorLayoutBase | ||
updateScrollerForContent():void | NavigatorLayoutBase | ||
updateScrollerForNavigation():void | NavigatorLayoutBase |
horizontalAlign | property |
horizontalAlign:String
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The horizontal alignment of layout elements.
If the value is "left"
, "right"
, or "center"
then the
layout element is aligned relative to the container's contentWidth
property.
If the value is "contentJustify"
, then the layout element's actual
width is set to the contentWidth
of the container.
The contentWidth
of the container is the width of the largest layout element.
If all layout elements are smaller than the width of the container,
then set the width of all layout elements to the width of the container.
If the value is "justify"
then the layout element's actual width
is set to the container's width.
This property does not affect the layout's measured size.
The default value is "justify"
.
public function get horizontalAlign():String
public function set horizontalAlign(value:String):void
verticalAlign | property |
verticalAlign:String
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
The vertical alignment of layout elements.
If the value is "bottom"
, "middle"
,
or "top"
then the layout elements are aligned relative
to the container's contentHeight
property.
If the value is "contentJustify"
then the actual
height of the layout element is set to
the container's contentHeight
property.
The content height of the container is the height of the largest layout element.
If all layout elements are smaller than the height of the container,
then set the height of all the layout elements to the height of the container.
If the value is "justify"
then the actual height
of the layout elements is set to the container's height.
This property does not affect the layout's measured size.
The default value is "justify"
.
public function get verticalAlign():String
public function set verticalAlign(value:String):void
StackLayout | () | Constructor |
public function StackLayout()
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Constructor.
restoreElement | () | method |
override protected function restoreElement(element:IVisualElement):void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4 |
Runtime Versions : | Flash Player 10, AIR 1.5 |
Restores the element to reset any changes to is visible properties. This method should be overridden in a subclass to return any elements used in the layout to its default state when it is removed from the targets displayList or when the target is removed from the layout.
Parameters
element:IVisualElement — The element to be restored.
|