Package | feathers.controls |
Class | public class TabNavigatorItem |
Inheritance | TabNavigatorItem Object |
Implements | feathers.controls.supportClasses.IScreenNavigatorItem |
Product Version : | Feathers 3.1.0 |
TabNavigator
component.
See also
Property | Defined By | ||
---|---|---|---|
canDispose : Boolean [read-only]
Determines if a display object returned by getScreen()
can be disposed or not when a screen is no longer active. | TabNavigatorItem | ||
icon : DisplayObject
The optional icon to display on the tab. | TabNavigatorItem | ||
label : String
The label to display on the tab. | TabNavigatorItem | ||
properties : Object
A set of key-value pairs representing properties to be set on the
screen when it is shown. | TabNavigatorItem | ||
screenClass : Class
A Class that may be instantiated to create a
DisplayObject instance to display when the associated
tab is selected. | TabNavigatorItem | ||
screenDisplayObject : DisplayObject
A display object to be displayed by the TabNavigator
when the associted tab is selected. | TabNavigatorItem | ||
screenFunction : Function
A Function that may be called to return a
DisplayObject instance to display when the associated
tab is selected. | TabNavigatorItem | ||
transition : Function
A custom transition for this screen only. | TabNavigatorItem |
Method | Defined By | ||
---|---|---|---|
TabNavigatorItem(classOrFunctionOrDisplayObject:Object = null, label:String = null, icon:DisplayObject = null)
Constructor. | TabNavigatorItem | ||
getScreen():DisplayObject
Returns a display object instance of this screen. | TabNavigatorItem |
canDispose | property |
canDispose:Boolean
[read-only]
Determines if a display object returned by getScreen()
can be disposed or not when a screen is no longer active.
public function get canDispose():Boolean
icon | property |
icon:DisplayObject
The optional icon to display on the tab.
public function get icon():DisplayObject
public function set icon(value:DisplayObject):void
label | property |
label:String
The label to display on the tab.
public function get label():String
public function set label(value:String):void
properties | property |
properties:Object
A set of key-value pairs representing properties to be set on the screen when it is shown. A pair's key is the name of the screen's property, and a pair's value is the value to be passed to the screen's property.
public function get properties():Object
public function set properties(value:Object):void
screenClass | property |
screenClass:Class
A Class
that may be instantiated to create a
DisplayObject
instance to display when the associated
tab is selected. A new instance of the screen will be instantiated
every time that it is shown by the TabNavigator
. The
screen's state will not be saved automatically, but it may be saved
in properties
, if needed.
The default value is null
.
public function get screenClass():Class
public function set screenClass(value:Class):void
See also
screenDisplayObject | property |
screenDisplayObject:DisplayObject
A display object to be displayed by the TabNavigator
when the associted tab is selected. The same instance will be reused
every time that it is shown by the TabNavigator
. Whe
the screen is hidden and shown again, its state will remain the same
as when it was hidden. However, the screen will also be kept in
memory even when it isn't displayed, limiting the resources that are
available for other views.
Using screenClass
or screenFunction
instead of screenDisplayObject
is the recommended best
practice. In general, screenDisplayObject
should only be
used in rare situations where instantiating a new screen would be
extremely expensive.
The default value is null
.
public function get screenDisplayObject():DisplayObject
public function set screenDisplayObject(value:DisplayObject):void
See also
screenFunction | property |
screenFunction:Function
A Function
that may be called to return a
DisplayObject
instance to display when the associated
tab is selected. A new instance of the screen will be instantiated
every time that it is shown by the TabNavigator
. The
screen's state will not be saved automatically, but it may be saved
in properties
, if needed.
The default value is null
.
public function get screenFunction():Function
public function set screenFunction(value:Function):void
See also
transition | property |
transition:Function
A custom transition for this screen only. If null
,
the default transition
defined by the
TabNavigator
will be used.
In the following example, the tab navigator item is given a custom transition:
item.transition = Fade.createFadeInTransition();
A number of animated transitions may be found in the feathers.motion package. However, you are not limited to only these transitions. It's possible to create custom transitions too.
A custom transition function should have the following signature:
function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void
Either of the oldScreen
and newScreen
arguments may be null
, but never both. The
oldScreen
argument will be null
when the
first screen is displayed or when a new screen is displayed after
clearing the screen. The newScreen
argument will
be null when clearing the screen.
The completeCallback
function must be called
when the transition effect finishes. This callback indicate to the
tab navigator that the transition has finished. This function has
the following signature:
function(cancelTransition:Boolean = false):void
The first argument defaults to false
, meaning that
the transition completed successfully. In most cases, this callback
may be called without arguments. If a transition is cancelled before
completion (perhaps through some kind of user interaction), and the
previous screen should be restored, pass true
as the
first argument to the callback to inform the tab navigator that
the transition is cancelled.
The default value is null
.
public function get transition():Function
public function set transition(value:Function):void
See also
TabNavigatorItem | () | Constructor |
public function TabNavigatorItem(classOrFunctionOrDisplayObject:Object = null, label:String = null, icon:DisplayObject = null)
Constructor.
ParametersclassOrFunctionOrDisplayObject:Object (default = null )
| |
label:String (default = null )
| |
icon:DisplayObject (default = null )
|
getScreen | () | method |
public function getScreen():DisplayObject
Returns a display object instance of this screen.
ReturnsDisplayObject |