class StackNavigator
package feathers.controls.navigators
extends BaseNavigator › FeathersControl › MeasureSprite › ValidatingSprite
A "view stack"-like container that supports navigation between items with history. New items are pushed to the top of a stack, and popping the active item will navigate to the previous item.
This component is designed for use in native apps. For web browser apps,
consider using RouterNavigator
instead.
The following example creates a stack navigator, adds an item, and displays it as the root of the history:
var navigator = new StackNavigator();
navigator.addItem("mainMenu", new StackItem(MainMenuScreen));
this.addChild(navigator);
navigator.rootItemID = "mainMenu";
1.0.0
.See also:
Constructor
Variables
popSwipeActiveEdgeSize:Float
The size, measured in pixels, of the region where a pop swipe gesture may begin.
1.0.0
.See also:
popSwipeEnabled:Bool
If true
, a swipe left with touch may be used to pop the current view.
1.0.0
.See also:
rootItemID:String
Sets the first item at the bottom of the history stack, known as the root item. When this item is shown, there will be no transition.
If the history stack currently contains items when you set this property, they will all be popped from the stack without a transition. In other words, setting this property will completely erase the current history.
In the following example, the root item ID is set:
navigator.rootItemID = "my-item-id";
1.0.0
.See also:
simulateTouch:Bool
Determines if mouse events should be treated like touch events when detecting a pop swipe.
1.0.0
.See also:
read onlystackSize:Int
The number of items that appear in the history stack, including the root item and the currently active item.
1.0.0
.popTransition:(DisplayObject, DisplayObject) ‑> IEffectContext
The default transition to use for pop actions, if not overridden in the
call to popItem()
.
1.0.0
.See also:
pushTransition:(DisplayObject, DisplayObject) ‑> IEffectContext
The default transition to use for push actions, if not overridden in the
call to pushItem()
.
1.0.0
.See also:
replaceTransition:(DisplayObject, DisplayObject) ‑> IEffectContext
The default transition to use for replace actions, if not overridden in
the call to replaceItem()
.
1.0.0
.See also:
Methods
addItem(item:StackItem):Void
Registers a new item. The id
property of the item should be used to
reference the same item in other method calls, like pushItem()
or
removeItem()
.
1.0.0
.See also:
getItem(id:String):StackItem
Returns the StackItem
that was registered by passing the specified
identifier to addItem()
.
1.0.0
.popAll(?transition:(DisplayObject, DisplayObject) ‑> IEffectContext):Void
Pops all items from the history stack, leaving the StackNavigator
completely empty, with no active item.
An optional transition may be specified. If null
, the value of the
popTransition
property will be used instead.
1.0.0
.See also:
popItem(?returnedObject:Dynamic, ?transition:(DisplayObject, DisplayObject) ‑> IEffectContext):DisplayObject
Pops the current item from the top of the history stack, restoring the
previous item from the history as the new active item. If the "root"
item is visible, popping has no effect and the root item will remain
visible. To remove all items from the history stack, including the root
item, use popAll()
instead.
An optional transition may be specified. If null
, the value of the
popTransition
property will be used instead.
Returns a reference to the new view, unless a transition is already
active when popItem()
is called. In that case, the new item will be
queued until the previous transition has completed, and popItem()
will return null
.
1.0.0
.See also:
popToRootItem(?returnedObject:Dynamic, ?transition:(DisplayObject, DisplayObject) ‑> IEffectContext):DisplayObject
Pops all items from the history stack, except the root item. The root item will become the new active item.
An optional transition may be specified. If null
, the value of the
popTransition
property will be used instead.
Returns a reference to the new view, unless a transition is already
active when popToRootItem()
is called. In that case, the new item will
be queued until the previous transition has completed, and
popToRootItem()
will return null
.
1.0.0
.See also:
popToRootItemAndReplace(id:String, ?inject:Dynamic ‑> Void, ?transition:(DisplayObject, DisplayObject) ‑> IEffectContext):DisplayObject
Returns to the root of the history stack, but replaces the root item with a different item instead.
An optional transition may be specified. If null
, the value of the
popTransition
property will be used instead.
Returns a reference to the new view, unless a transition is already
active when popToRootItemAndReplace()
is called. In that case, the new
item will be queued until the previous transition has completed, and
popToRootItemAndReplace()
will return null
.
1.0.0
.See also:
pushItem(id:String, ?inject:Dynamic ‑> Void, ?transition:(DisplayObject, DisplayObject) ‑> IEffectContext):DisplayObject
Pushes an item onto the top of the history stack to become the new active item.
Note: Multiple instances of the same item are allowed to be added to the history stack, if desired.
An optional transition may be specified. If null
, the value of the
pushTransition
property will be used instead.
Returns a reference to the new view, unless a transition is already
active when pushItem()
is called. In that case, the new item will be
queued until the previous transition has completed, and pushItem()
will return null
.
1.0.0
.See also:
removeItem(id:String):StackItem
Removes an existing item using the identifier assigned to it in the call
to addItem()
.
1.0.0
.See also:
replaceItem(id:String, ?inject:Dynamic ‑> Void, ?transition:(DisplayObject, DisplayObject) ‑> IEffectContext):DisplayObject
Replaces the current item on the top of the history stack with a new item, making the new item the active item. May be used in the case where you want to navigate from item A to item B and then to item C, but when popping item C, you want to skip item B and return to item A instead.
An optional transition may be specified. If null
, the value of the
replaceTransition
property will be used instead.
Returns a reference to the new view, unless a transition is already
active when replaceItem()
is called. In that case, the new item will
be queued until the previous transition has completed, and
replaceItem()
will return null
.
1.0.0
.See also: