Skip to content

Titanium.UI.Tab

A tab instance for a TabGroup.

A TabGroup tab instance. Each tab includes a button and one or more windows, which holds the "contents" of the tab. Users can select a tab by clicking on the tab button.

Use the Titanium.UI.createTab method or <Tab> Alloy element to create a tab.

Use TabGroup.setActiveTab to switch between tabs in a tab group.

The behavior of tabs and tab groups follows the platform's native navigation style, which varies significantly between platforms.

iOS Platform Implementation Notes

On iOS, the tab maintains a stack of windows. Windows on top of the stack can partially or totally obscure windows lower in the stack. Calling open opens a new window on top of the window stack. When a window is closed, either by the user or by code, the window is removed from the stack, making the previous window visible. The root tab window cannot be removed.

On iOS the tab controls are generally kept on screen to allow a user to navigate inside the app. Tab controls are hidden when the user is performing a modal task (for example, composing a message). In this case, the app should provide a button in the navigation bar to return to the previous screen. On iOS, the window should also be opened as modal. On iOS, The tab controls can also be hidden by opening the new window with tabBarHidden set to true.

When closing a tab window in iOS, you should always use the Tab.close method to ensure that the tab group maintains its navigation state.

Android Platform Implementation Notes

On Android, the tab does not maintain a stack of windows. Calling open opens a new, heavyweight window, which by default covers the tab group entirely. This seems quite different from the iOS model, but it is the standard model for Android applications. Users can use the Back button to close the window and return to the tab group.

On Android, tab windows can be closed using either Tab.close or Window.close. Since no window stack is maintained, only a single window opened using Tab.open can be closed using Tab.close.

As on iOS, the root tab window cannot be closed.

Extends: Titanium.UI.View · Since: 0.8

Properties #

accessibilityDisableLongPress#

extendedcreation only

Type: Boolean

Boolean value to remove the long press notification for the device's accessibility service.

Will disable the "double tap and hold for long press" message when selecting an item.

active#

Type: Boolean

true if this tab is active, false if it is not.

The tab can be activated by setting the property, but since this property is
platform-specific, using TabGroup.setActiveTab
is recommended instead.

activeIcon#

Type: String

Icon URL for this tab when active.

If unspecified, iOS uses a tint color to indicate the active tab. See
icon for more information.

If the icon provided is larger than [30 pixels (60 pixels for retina, 90 pixels for super-retina)]
(https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/image-size-and-resolution/),
this image will be scaled to fit.

activeIconIsMask#

Type: Boolean

Defines if the active icon property of the tab must be used as a mask.

This is the equivalent of the iconIsMask property, but for the active icon. When this is true, the active icon is
tinted with the color specified in tabsTintColor. When this is false the image is rendered as is, though the
title of the tab is still tinted.

activeTintColor#

Type: String

Defines the color of the tab icon when it is active.

activeTitleColor#

Type: String, Titanium.UI.Color

Defines the color of the title of tab when it's active.

The color of the title of the tab when it's active.

apiName#

extended

Type: String

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button
returns Ti.UI.Button.

backgroundColor#

Type:

Sets the color of the tab when it is inactive.

For information about color values, see the "Colors" section of Titanium.UI.

backgroundDisabledColor#

extended

Type: String

Disabled background color of the view, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.
Defaults to the normal background color of this view.

backgroundDisabledImage#

extended

Type: String

Disabled background image for the view, specified as a local file path or URL.

If backgroundDisabledImage is undefined, and the normal background imagebackgroundImage
is set, the normal image is used when this view is disabled.

backgroundFocusedColor#

Type:

Sets the color of the tab when it is focused.

On the Android platform, this sets the color of the active tab and is only supported by
TABS_STYLE_BOTTOM_NAVIGATION.

For information about color values, see the "Colors" section of Titanium.UI.

backgroundFocusedImage#

extended

Type: String

Focused background image for the view, specified as a local file path or URL.

For normal views, the focused background is only used if focusable is true.
If backgroundFocusedImage is undefined, and the normal background image backgroundImage
is set, the normal image is used when this view is focused.

backgroundImage#

extended

Type: String

Background image for the view, specified as a local file path or URL.

Default behavior when backgroundImage is unspecified depends on the type of view and the platform.
For generic views, no image is used. For most controls (buttons, textfields, and so on), platform-specific default images are used.

backgroundSelectedColor#

extended

Type: String, Titanium.UI.Color

Selected background color of the view, as a color name or hex triplet.

For information about color values, see the "Colors" section of Titanium.UI.
Defaults to transparent, so the background color of this view will be used.

backgroundSelectedImage#

extended

Type: String

Selected background image URL for the view, specified as a local file path or URL.

For normal views, the selected background is only used if focusable is true.

If backgroundSelectedImage is undefined, and the normal background image backgroundImage is set
the normal image is used when this view is selected.

badge#

Type: String

Badge value for this tab. null indicates no badge.

On the Android platform you will need to use a Theme with parent="Theme.MaterialComponents.*"
in order to use a badge. You have to pass a number as a string. Non-numeric characters will not be displayed.

On iOS, a badge will only be shown if the tab has been assigned an icon. Text only tabs do not support badges.

badgeBackgroundColor#

Type: String, Titanium.UI.Color

If this item displays a badge, this color will be used for the badge's background.
If set to null, the default background color will be used instead.

For information about color values, see the "Colors" section of Titanium.UI.

badgeColor (deprecated)#

Type: String, Titanium.UI.Color

If this item displays a badge, this color will be used for the badge's background.
If set to null, the default background color will be used instead.

For information about color values, see the "Colors" section of Titanium.UI.

badgeTextColor#

Type: String, Titanium.UI.Color

Set the text color of the badge.

For information about color values, see the "Colors" section of Titanium.UI.

bubbleParent#

extended

Type: Boolean

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often
established by the add() method. For example, for a button added to a window, a
click event on the button would bubble up to the window. Other common parents are
table sections to their rows, table views to their sections, and scrollable views
to their views. Set this property to false to disable the bubbling to the proxy's parent.

clipMode#

extended

Type: Number

View's clipping behavior.

Setting this to Titanium.UI.iOS.CLIP_MODE_ENABLED enforces all child views to be clipped to this views bounds.
Setting this to Titanium.UI.iOS.CLIP_MODE_DISABLED allows child views to be drawn outside the bounds of this view.
When set to Titanium.UI.iOS.CLIP_MODE_DEFAULT or when this property is not set, clipping behavior is inferred.
See section on iOS Clipping Behavior in Titanium.UI.View.

Defaults to undefined. Behaves as if set to Titanium.UI.iOS.CLIP_MODE_DEFAULT.

elevation#

extended

Type: Number

Base elevation of the view relative to its parent in pixels.

The elevation of a view determines the appearance of its shadow.
Higher elevations produce larger and softer shadows.

Note: The elevation property only works on Titanium.UI.View objects.
Many Android components have a default elevation that cannot be modified.
For more information, see
Google design guidelines: Elevation and shadows.

filterTouchesWhenObscured#

extended

Type: Boolean

Discards touch related events if another app's system overlay covers the view.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

Setting this property to true causes touch related events (including "click") to not be fired
if a system overlay overlaps the view.

hiddenBehavior#

extended

Type: Number

Sets the behavior when hiding an object to release or keep the free space

If setting hiddenBehavior to Titanium.UI.HIDDEN_BEHAVIOR_GONE it will automatically release the space the view occupied.
For example: in a vertical layout the views below the object will move up when you hide
an object with hiddenBehavior:Titanium.UI.HIDDEN_BEHAVIOR_GONE.

Defaults to Titanium.UI.HIDDEN_BEHAVIOR_INVISIBLE.

horizontalMotionEffect#

extended

Type: MinMaxOptions

Adds a horizontal parallax effect to the view

Note that the parallax effect only happens by tilting the device so results can not be seen on Simulator.
To clear all motion effects, use the Titanium.UI.clearMotionEffects method.

icon#

Type: String

Icon URL for this tab.

iOS Tab Icons

On iOS, tab icons are usually white with a transparent background. The system uses
a transparent tint color to indicate whether the tab is active or inactive. In the
inactive state, the tint color is based on the tab bar's color
tabsBackgroundColor, which defaults
to black. In the active state, the tint color is usually blue. Prior to Titanium
3.1, there was no way to override the default active icon tint.

Some icon-related features:

  • You can specify the active tab's tint color as
    activeTabIconTint.

  • You can set separate icon images for the active and inactive states. If
    activeIcon is set, then icon is used in the
    inactive state, and activeIcon is used in the active state. No default tint
    is applied to either icon.

If the icon provided is larger than [30 pixels (60 pixels for retina, 90 pixels for super-retina)]
(https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/image-size-and-resolution/),
this image will be scaled to fit if used with activeIcon, and cropped at the bottom
otherwise.

Android Tab Icons

Can be used in combination with iconFamily in a BottomNavigation setup with experimental:true.

iconFamily#

Type: String

Specifies the font family or specific font to use.

When using a BottomNavigation setup with experimental:true you can use this property in combination
with an icon to use an icon-font for the tab icons:

'#tab1': {
  icon: "\ueac1",
  iconFamily: "tabler-icons"
}

iconInsets#

Type: TabIconInsets

The icon inset or outset for each edge.

Use this property for example to center an icon without providing a title. To do that, set the
insets to { top: 6 } and/or { left: 6 }. The right and bottom are calculated internally to prevent the
icon from mutating.

iconIsMask#

Type: Boolean

Defines if the icon property of the tab must be used as a mask.

When this property is true, the color data of the image specified as the icon is ignored and the image is used as an alpha mask.
When this is false, the color data of the image is preserved.

id#

extended

Type: String

View's identifier.

The id property of the Ti.UI.View represents the view's identifier. The identifier string does
not have to be unique. You can use this property with Titanium.UI.View.getViewById method.

keepHardwareMode#

extended

Type: Boolean

A value indicating the render mode of the View

Set to true to keep hardware mode when using a border and transparent backgrounds.

lifecycleContainer#

extended

Type: Titanium.UI.Window, Titanium.UI.TabGroup

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks
will also be called on the proxy. Proxies that require the activity lifecycle will need this property set
to the appropriate containing Window or TabGroup.

overrideCurrentAnimation#

extendedcreation only

Type: Boolean

When on, animate call overrides current animation if applicable.

If this property is set to false, the animate call is ignored if the view is currently being animated.

Defaults to undefined but behaves as false

previewContext#

extended

Type: Titanium.UI.iOS.PreviewContext

The preview context used in the 3D-Touch feature "Peek and Pop".

Preview context to present the "Peek and Pop" of a view. Use an configured instance
of Titanium.UI.iOS.PreviewContext here.

Note: This property can only be used on devices running iOS 9 or later and supporting 3D-Touch.
It is ignored on older devices and can manually be checked using Titanium.UI.iOS.forceTouchSupported.

pullBackgroundColor#

extended

Type: String, Titanium.UI.Color

Background color of the wrapper view when this view is used as either Titanium.UI.ListView.pullView or Titanium.UI.TableView.headerPullView.

Defaults to undefined. Results in a light grey background color on the wrapper view.

rotation#

extended

Type: Number

Clockwise 2D rotation of the view in degrees.

Translation values are applied to the static post layout value.

rotationX#

extended

Type: Number

Clockwise rotation of the view in degrees (x-axis).

Translation values are applied to the static post layout value.

rotationY#

extended

Type: Number

Clockwise rotation of the view in degrees (y-axis).

Translation values are applied to the static post layout value.

scaleX#

extended

Type: Number

Scaling of the view in x-axis in pixels.

Translation values are applied to the static post layout value.

scaleY#

extended

Type: Number

Scaling of the view in y-axis in pixels.

Translation values are applied to the static post layout value.

tintColor#

Type: String

Defines the color of the tab icon.

title#

Type: String

Title for this tab.

titleColor#

Type: String, Titanium.UI.Color

Defines the color of the title of tab when it's inactive.

The color of the title of the tab when it's inactive.

titleid#

Type: String

Key identifying a string from the locale file to use for the tab title. Only one of title or titleid should be specified.

tooltip#

extended

Type: String

The default text to display in the control's tooltip.

Assigning a value to this property causes the tool tip to be displayed for the view.
Setting the property to null cancels the display of the tool tip for the view.
Note: This property is only used for apps targeting macOS Catalyst.

touchEnabled#

extended

Type: Boolean

Determines whether view should receive touch events.

If false, will forward the events to peers.

touchFeedback#

extended

Type: Boolean

A material design visual construct that provides an instantaneous visual confirmation of touch point.

Touch feedback is only applied to a view's background. It is never applied to the view's foreground content
such as a Titanium.UI.ImageView's image.

For Titanium versions older than 9.1.0, touch feedback only works if you set the
Titanium.UI.View.backgroundColor property to a non-transparent color.

touchFeedbackColor#

extended

Type: String

Optional touch feedback ripple color. This has no effect unless touchFeedback is true.

Defaults to provided theme color.

transitionName#

extended

Type: String

A name to identify this view in activity transition.

Name should be unique in the View hierarchy.

translationX#

extended

Type: Number

Horizontal location of the view relative to its left position in pixels.

Translation values are applied to the static post layout value.

translationY#

extended

Type: Number

Vertical location of the view relative to its top position in pixels.

Translation values are applied to the static post layout value.

translationZ#

extended

Type: Number

Depth of the view relative to its elevation in pixels.

Translation values are applied to the static post layout value.

verticalMotionEffect#

extended

Type: MinMaxOptions

Adds a vertical parallax effect to the view

Note that the parallax effect only happens by tilting the device so results can not be seen on Simulator.
To clear all motion effects, use the Titanium.UI.clearMotionEffects method.

viewShadowColor#

extended

Type: String, Titanium.UI.Color

Determines the color of the shadow.

iOS Defaults to undefined. Behaves as if transparent. Android default is black.
On Android you can set <item name="android:ambientShadowAlpha">0.5</item> and
<item name="android:spotShadowAlpha">0.5</item> in your theme to change the
opacity.

viewShadowOffset#

extended

Type: Point

Determines the offset for the shadow of the view.

Defaults to undefined. Behaves as if set to (0,-3)

viewShadowRadius#

extended

Type: Number, String

Determines the blur radius used to create the shadow.

Defaults to undefined. Behaves as if set to 3. Accepts density units as of 10.0.1.

window#

creation only

Type: Titanium.UI.Window

Root-level tab window. All tabs must have at least one root-level tab window.

Methods #

addEventListener #

extended

Adds the specified callback as an event listener for the named event.

Parameters:
NameTypeSummaryOptional
nameStringName of the event.No
callbackCallback<Titanium.Event>Callback function to invoke when the event is fired.No

applyProperties #

extended

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that
myproxy[key] = value.

Parameters:
NameTypeSummaryOptional
propsDictionaryA dictionary of properties to apply.No

clearMotionEffects #

extended

Removes all previously added motion effects.

close #

Closes the top-level window for this tab.

On iOS, this method should be used when closing a window opened from a tab, to
correctly maintain the iOS tab group's navigation state. Note that the window to
be closed must be passed in as a parameter:

myTab.close(tabWin);

On Android, this method does not take a window parameter.

myTab.close();

On Android, if a window has been opened in front of the tab using Tab.open,
a subsequent call to Tab.close is equivalent to calling close on that window.
No window stack is maintained, so only the most-recently opened window on a given
tab can be closed in this way.

All platforms accept an optional options parameter. The only supported property
for this dictionary is the animated flag, which specifies whether the window
close should be animated. animated is true by default.

Parameters:
NameTypeSummaryOptional
windowTitanium.UI.WindowWindow to close. This parameter must be omitted on Android.
No
optionsObjectDictionary of display and animation settings to use when closing the window.
Identical to the options parameter to Window.close.
iOS only supports the animated parameter.
Yes

convertPointToView #

extended

Translates a point from this view's coordinate system to another view's coordinate system.

Returns null if either view is not in the view hierarchy.

Keep in mind that views may be removed from the view hierarchy if their window is blurred
or if the view is offscreen (such as in some situations with Titanium.UI.ScrollableView).

If this view is a Titanium.UI.ScrollView, the view's x and y offsets are subtracted from
the return value.

Parameters:
NameTypeSummaryOptional
pointPointA point in this view's coordinate system.

If this argument is missing an x or y property, or the properties can not be
converted into numbers, an exception will be raised.
No
destinationViewTitanium.UI.ViewView that specifies the destination coordinate system to convert to. If this argument
is not a view, an exception will be raised.
No

Returns: Point

fireEvent #

extended

Fires a synthesized event to any registered listeners.

Parameters:
NameTypeSummaryOptional
nameStringName of the event.No
eventDictionaryA dictionary of keys and values to add to the Titanium.Event object sent to the listeners.Yes

getViewById #

extended

Returns the matching view of a given view ID.

Parameters:
NameTypeSummaryOptional
idStringThe ID of the view that should be returned. Use the id property in your views to
enable it for indexing in this method.
No

Returns: Titanium.UI.View

insertAt #

extended

Inserts a view at the specified position in the children array.

Useful if the layout property is set to horizontal or vertical.

Parameters:
NameTypeSummaryOptional
paramsViewPositionOptionsPass an object that specifies the view to insert and optionally at which position (defaults to end)
No

open #

Opens a new window.

On iOS, the new window is opened as the top window in the tab's window stack. On Android, the new window is opened as a new, heavyweight window, obscuring the tab group.

Parameters:
NameTypeSummaryOptional
windowTitanium.UI.WindowWindow to open.No
optionsopenWindowParamsDictionary of display and animation settings to use when opening the window.
Identical to the options parameter to Window.open.
iOS only supports the animated parameter.
Yes

popToRootWindow #

Closes all windows that are currently opened inside the tab.

Note that only the close event of the most recently opened window is fired.

Parameters:
NameTypeSummaryOptional
optionsAnimatedOptionsiOS only: Options supporting a single animated boolean property to determine whether the windows
will be animated while being closed (default: false).
Yes

removeEventListener #

extended

Removes the specified callback as an event listener for the named event.

Multiple listeners can be registered for the same event, so the
callback parameter is used to determine which listener to remove.

When adding a listener, you must save a reference to the callback function
in order to remove the listener later:

var listener = function() { Ti.API.info("Event listener called."); }
window.addEventListener('click', listener);

To remove the listener, pass in a reference to the callback function:

window.removeEventListener('click', listener);
Parameters:
NameTypeSummaryOptional
nameStringName of the event.No
callbackCallback<Titanium.Event>Callback function to remove. Must be the same function passed to addEventListener.No

setWindow #

Sets the root window that appears in the tab.

You can only use this method to set the tab's root window before the TabGroup containing this tab
is opened, that is, once the TabGroup is displayed, you cannot change the root window
that appears in the tab.

Parameters:
NameTypeSummaryOptional
windowTitanium.UI.WindowRoot window of the tab.No

stopAnimation #

extended

Stops a running animation.

Stops a running view Animation.

toImage #

extended

Returns an image of the rendered view, as a Blob.

The honorScaleFactor argument is only supported on iOS.

Parameters:
NameTypeSummaryOptional
callbackCallback<Titanium.Blob>Function to be invoked upon completion. If non-null, this method will be performed
asynchronously. If null, it will be performed immediately.
Yes
honorScaleFactorBooleanDetermines whether the image is scaled based on scale factor of main screen. (iOS only)

When set to true, image is scale factor is honored. When set to false, the image in the
blob has the same dimensions for retina and non-retina devices.
Yes

Returns: Titanium.Blob

Events #

click #

Fired when this tab is clicked in the tab group.

dblclick #

extended

Fired when the device detects a double click against the view.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
obscuredBooleanReturns true if the double click passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

doubletap #

extended

Fired when the device detects a double tap against the view.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
obscuredBooleanReturns true if the double tap passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

focus #

extended

Fired when the view element gains focus.

This event only fires when using the trackball to navigate.

longpress #

extended

Fired when the device detects a long press.

A long press is generated by touching and holding on the touchscreen. Unlike a longclick,
it does not respond to the trackball button.

The event occurs before the finger is lifted.

A longpress and a longclick can occur together.

In contrast to a longclick, this event returns the x and y coordinates of the touch.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
obscuredBooleanReturns true if the long press passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

postlayout #

extended

Fired when a layout cycle is finished.

This event is fired when the view and its ancestors have been laid out.
The rect and size values
should be usable when this event is fired.

This event is typically triggered by either changing layout
properties or by changing the orientation of the device. Note that changing the
layout of child views or ancestors can also trigger a relayout of this view.

Note that altering any properties that affect layout from the postlayout callback
may result in an endless loop.

rotate #

extended

Fired when the device detects a two finger rotation.

This event is fired when doing a two finger rotation and returning the angle.
The event occurs continuously until a finger is lifted again.

Event Properties:
NameTypeSummary
rotateNumberRotation in degrees.

selected #

Fired when the tab is selected.

Event Properties:
NameTypeSummary
indexNumberIndex of the current active tab.
previousIndexNumberIndex of the previous active tab.
tabTitanium.UI.TabCurrent active tab object.
previousTabTitanium.UI.TabPrevious active tab object.

singletap #

extended

Fired when the device detects a single tap against the view.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
obscuredBooleanReturns true if the single tap passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

swipe #

extended

Fired when the device detects a swipe gesture against the view.

Event Properties:
NameTypeSummary
directionStringDirection of the swipe--either 'left', 'right', 'up', or 'down'.
xNumberX coordinate of the event's endpoint from the source view's coordinate system.
yNumberY coordinate of the event's endpoint from the source view's coordinate system.
obscuredBooleanReturns true if the swipe passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

touchcancel #

extended

Fired when a touch event is interrupted by the device.

A touchcancel can happen in circumstances such as an incoming call to allow the
UI to clean up state.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
forceNumberThe current force value of the touch event.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices.
sizeNumberThe current size of the touch area. Note: This property is only available on some Android devices.
maximumPossibleForceNumberMaximum possible value of the force property.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
altitudeAngleNumberA value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is
being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0.
Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later.
timestampNumberThe time (in seconds) when the touch was used in correlation with the system start up.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
azimuthUnitVectorInViewXNumberThe x value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
azimuthUnitVectorInViewYNumberThe y value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
obscuredBooleanReturns true if the touch passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

touchend #

extended

Fired when a touch event is completed.

On the Android platform, other gesture events, such as longpress or swipe, cancel touch
events, so this event may not be triggered after a touchstart event.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
forceNumberThe current force value of the touch event.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices.
sizeNumberThe current size of the touch area. Note: This property is only available on some Android devices.
maximumPossibleForceNumberMaximum possible value of the force property.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
altitudeAngleNumberA value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is
being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0.
Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later.
timestampNumberThe time (in seconds) when the touch was used in correlation with the system start up.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
azimuthUnitVectorInViewXNumberThe x value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
azimuthUnitVectorInViewYNumberThe y value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Penciland are 9.1 or later.
obscuredBooleanReturns true if the touch passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

touchmove #

extended

Fired as soon as the device detects movement of a touch.

Event coordinates are always relative to the view in which the initial touch occurred

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
forceNumberThe current force value of the touch event.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices.
sizeNumberThe current size of the touch area. Note: This property is only available on some Android devices.
maximumPossibleForceNumberMaximum possible value of the force property.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
altitudeAngleNumberA value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is
being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0.
Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later.
timestampNumberThe time (in seconds) when the touch was used in correlation with the system start up.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
azimuthUnitVectorInViewXNumberThe x value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
azimuthUnitVectorInViewYNumberThe y value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
obscuredBooleanReturns true if the touch passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

touchstart #

extended

Fired as soon as the device detects a touch gesture.

Event Properties:
NameTypeSummary
xNumberX coordinate of the event from the source view's coordinate system.
yNumberY coordinate of the event from the source view's coordinate system.
forceNumberThe current force value of the touch event.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices.
sizeNumberThe current size of the touch area. Note: This property is only available on some Android devices.
maximumPossibleForceNumberMaximum possible value of the force property.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
altitudeAngleNumberA value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is
being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0.
Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later.
timestampNumberThe time (in seconds) when the touch was used in correlation with the system start up.
Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
azimuthUnitVectorInViewXNumberThe x value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
azimuthUnitVectorInViewYNumberThe y value of the unit vector that points in the direction of the azimuth of the stylus.
Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
obscuredBooleanReturns true if the touch passed through an overlapping window belonging to another app.

This is a security feature to protect an app from "tapjacking", where a malicious app can use a
system overlay to intercept touch events in your app or to trick the end-user to tap on UI
in your app intended for the overlay.

unselected #

Fired when the tab is no longer selected.

Event Properties:
NameTypeSummary
indexNumberIndex of the current active tab.
previousIndexNumberIndex of the previous active tab.
tabTitanium.UI.TabCurrent active tab object.
previousTabTitanium.UI.TabPrevious active tab object.

Examples #

Simple Tab Example

In this example, we create a simple tab and add it to a tab group.

var window = Ti.UI.createWindow({
    title: 'My Tab'
});

var tab = Ti.UI.createTab({
    window: window,
    title: 'My Tab',
    icon: 'myicon.png'
});

tabGroup.addTab(tab);

Alloy XML Markup

Previous example an an Alloy view.

<Alloy>
    <TabGroup id="tabGroup">
        <Tab id="tab" title="My Tab" icon="myicon.png">
            <Window id="window" title="My Tab" />
        </Tab>
      </TabGroup>
</Alloy>

Titanium SDK Documentation