Skip to content
Titanium SDK
Titanium Docs
Version13.4.1

Titanium.UI.TabGroup

viewAndroidiPhoneiPadmacOSsince 0.9

Extends Titanium.UI.WindowTitanium.UI.ViewTitanium.Proxy

A tabbed group of windows.

Android iOS
Android

A tab group can contain one or more Tab objects, each of which has an associated tab control that is used to bring it into focus.

Use the Titanium.UI.createTabGroup method or <TabGroup> Alloy element to create a tab group that, in turn, contains one or more <Tab> elements.

You can add tabs to the group using addTab, and programmatically switch to a specific tab using setActiveTab.

Platform Implementation Notes

When using a tab group, note the following differences between platforms:

  • The tab group controls are positioned at the top of the display on Android and at the bottom on iOS.

  • On Android, only one tab group may exist at one time. A tab group may be closed to allow a new one to be opened later, but the root of the application must be a heavyweight window to prevent it exiting. Tabs cannot be removed from the tab group once added, and tabs cannot be reordered.

  • If you use a BottomNavigation on Android with a Material 3 theme you should set experimental:true.

  • On iOS, more than one tab group may exist, and may be opened and closed as required. Each tab can contain a stack of windows, and the user can switch between them by tapping the tab's associated control. Tabs can be removed, and the user may (optionally) be allowed to reorder tabs.

  • On iOS, it is also possible to add tabs by updating the tabs property, and to switch active tabs by setting the active property on one of the tabs to true. Since these mechanisms are platform-specific, it is recommended that you use addTab and setActiveTab instead.

  • If you use the iOS-specific mechanisms, it is possible to add multiple active tabs to a tab group. In this case, the result of which tab is initially selected is undefined.

Further Reading

If using tab groups on iOS, see iOS UI Element Usage Guidelines.

Examples

Alloy XML Markup

Default Titanium project as an Alloy view.

<Alloy>
    <TabGroup backgroundColor="white" >
        <Tab id="tab1" title="Tab 1" icon="KS_nav_views.png">
            <Window id="win1" title="Tab 1">
                <Label id="label1" color="#999">I am Window 1</Label>
            </Window>
        </Tab>
        <Tab id="tab2" title="Tab 2" icon="KS_nav_views.png">
            <Window id="win2" title="Tab 2">
                <Label id="label2" color="#999">I am Window 2</Label>
            </Window>
        </Tab>
        <!-- Use the Require tag to include external Ti.UI.Tab views -->
    </TabGroup>
</Alloy>

Classic Titanium Example

Simple two-tabbed app.

var win1 = Ti.UI.createWindow({
    backgroundColor: 'blue',
    title: 'Blue'
});
win1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));

var win2 = Ti.UI.createWindow({
    backgroundColor: 'red',
    title: 'Red'
});
win2.add(Ti.UI.createLabel({text: 'I am a red window.'}));

var tab1 = Ti.UI.createTab({
    window: win1,
    title: 'Blue'
}),
tab2 = Ti.UI.createTab({
    window: win2,
    title: 'Red'
}),
tabGroup = Ti.UI.createTabGroup({
    tabs: [tab1, tab2]
});
tabGroup.open();

Example with different colors

Create a TabGroup with different active and inactive colors.

function createTab(title, icon) {
  const window = Ti.UI.createWindow({ title: title });
  window.add(Ti.UI.createLabel({ text: title + " View" }));
    const tab = Ti.UI.createTab({
    title: title,
    icon: icon,
    window: window,
  });
  return tab;
}

const tabGroup = Ti.UI.createTabGroup({
  tabs: [
    createTab("Tab 1", "/assets/images/tab1.png"),
    createTab("Tab 2", "/assets/images/tab2.png"),
    createTab("Tab 3", "/assets/images/tab1.png")
  ],
  activeTintColor: "red",
  activeTitleColor: "red",
  tintColor: "purple",
  titleColor: "purple",
  tabsBackgroundColor: "#F7F7F7",
});
tabGroup.open();

BottomNavigation Material3 example

Create a BottomNavigation TabGroup with a Material3 theme using the new layout.

const win1 = Ti.UI.createWindow();
const win2 = Ti.UI.createWindow();
const tab1 = Ti.UI.createTab({
	window: win1,
	title: 'Tab 1',
	icon: '/images/appicon.png'
});
const tab2 = Ti.UI.createTab({
	window: win2,
	title: 'Tab 2',
	icon: '/images/appicon.png'
});

win1.add(Ti.UI.createLabel({text: "Tab 1 - click to set badge"}));
win2.add(Ti.UI.createLabel({text: "Tab 2"}));
win1.addEventListener("click", function() {
	tab1.badge = 20;
});

const bottomNav = Ti.UI.createTabGroup({
	tabs: [tab1, tab2],
	theme: "Theme.Titanium.Material3.DayNight",
	experimental: true,
	style: Ti.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION
});

bottomNav.open();

Properties 136

activeTintColor

Stringsince 9.0.3

The activeTintColor to apply to tabs.

This property affects the tint of selected tab icons.

Default: null

activity

Titanium.Android.ActivityAndroidsince 3.0.0read-only

Reference to the Android Activity object associated with this tab group.

An Activity object is not created until the tab group opens. Before the tab group opens, activity refers to an empty JavaScript object. You can set properties on this object but cannot invoke any Activity methods on it. Once the tab group opens, the actual Activity object is created, using any properties set on the JavaScript object. At this point, you can call methods on the activity and access any properties that are set when the activity is created.

Prior to Release 3.4.0, you can only set properties on the activity after the tab group opens.

allowUserCustomization

BooleaniPhoneiPadmacOS

Allow the user to reorder tabs in the tab group using the Edit button on the More tab.

Set to false to prevent tab reordering.

Default: true

apiName

Stringsince Android 3.2.0, iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0read-only

Inherited from Titanium.Proxy

The name of the API that this proxy corresponds to.

autoAdjustScrollViewInsets

BooleaniPhoneiPadmacOSsince iPhone 3.1.3, iPad 3.1.3, macOS 9.2.0

Inherited from Titanium.UI.Window

Specifies whether or not the view controller should automatically adjust its scroll view insets.

autoTabTitle

BooleanAndroidsince 11.0.0

If set to true it will automatically set the actionbar title to the current tabs window title.

Default: false

Default navigation bar color (typically for the More tab), as a color name or hex triplet.

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

A value of transparent results in a semi-opaque black bar style.

barImage

StringiPhoneiPadmacOS

Inherited from Titanium.UI.Window

Background image for the nav bar, specified as a URL to a local image.

bottomAccessoryView

Titanium.UI.ViewiPhoneiPadmacOSsince 13.0.0iOS 26.0+

View shown as a bottom accessory attached to the tab group.

Adds a custom view as a bottom accessory of the tab group. Available on iOS 26+ only (uses the new iOS tab group accessories).

Note: Label subviews require explicit width and height set to render properly. Be sure to set width and height on any Ti.UI.Label added to this view.

bubbleParent

Booleansince Android 3.0.0, iPhone 3.0.0, iPad 3.0.0, macOS 9.2.0

Inherited from Titanium.Proxy

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

Default: true

closed

Booleansince 9.1.0read-only

Inherited from Titanium.UI.Window

Determines whether this Window is closed.

Default: true

editButtonTitle

StringiPhoneiPadmacOS

Title for the edit button on the More tab.

elevation

NumberAndroidsince 5.0.0Android 5+

Inherited from Titanium.UI.View

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

enabled

Numbersince 12.7.0

Enables or disables the menu in a BottomNavigation. If disabled you can't change to a different tab.

Default: true

exitOnClose

BooleanAndroid

Boolean value indicating if the application should exit when closing the tab group, whether via Android back button or the close method.

Starting in 3.4.2 you can set this property at any time. In earlier releases you can only set this as a createTabGroup({...}) option.

Default: True if tab group is opened on top of the root activity. False otherwise.

experimental

BooleanAndroidsince 12.7.0

Only used for a BottomNavigation setup. If set to true it will use an optimized BottomNavigation setup with fixes for Material 3 layouts and new properties: indicatorColor and iconFamily. The new BottomNavigation will only load the active Activity and doesn't support swipeable.

Default: false

extendSafeArea

Booleansince Android 7.5.0, iPhone 6.3.0, iPad 6.3.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Specifies whether the screen insets/notches are allowed to overlap the window's content or not.

Default: `false` on Android, `true` on iOS.

flagSecure

BooleanAndroidsince 3.3.0

Inherited from Titanium.UI.Window

Treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.

Default: false

focused

Booleansince 9.1.0read-only

Inherited from Titanium.UI.Window

Determines whether this TextArea has focus.

Default: false

forceBottomPosition

BooleaniPadsince 13.1.0iOS 18.0+

Force tab bar to bottom position.

A new floating tab bar was introduced in iPadOS 18. It is displayed without tab icons and at the top of the screen. This property forces the tab bar to be displayed in the old style with icons and at the bottom of the screen (as on iPhone).

Default: false

hidesBackButton

Booleansince Android 8.0.0, iPhone 7.5.0, iPad 7.5.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Set this to true to hide the back button of navigation bar.

Default: false

hidesBarsOnSwipe

BooleaniPhoneiPadmacOSsince iPhone 6.0.0, iPad 6.0.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Set this to true to hide the navigation bar on swipe.

Default: false

hidesBarsOnTap

BooleaniPhoneiPadmacOSsince iPhone 6.0.0, iPad 6.0.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Set this to true to hide the navigation bar on tap.

Default: false

hideShadow

BooleaniPhoneiPadmacOSsince iPhone 3.2.0, iPad 3.2.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Set this to true to hide the shadow image of the navigation bar.

Default: false

hidesSearchBarWhenScrolling

BooleaniPhoneiPadmacOSsince iPhone 8.1.0, iPad 8.1.0, macOS 9.2.0

Inherited from Titanium.UI.Window

A Boolean value indicating whether the integrated search bar is hidden when scrolling any underlying content.

Default: true

homeIndicatorAutoHidden

BooleaniPhoneiPadmacOSsince iPhone 7.3.0, iPad 7.3.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Boolean value indicating whether the system is allowed to hide the visual indicator for returning to the Home screen.

Default: false

includeOpaqueBars

BooleaniPhoneiPadmacOSsince iPhone 3.1.3, iPad 3.1.3, macOS 9.2.0

Inherited from Titanium.UI.Window

Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar).

interactiveDismissModeEnabled

BooleandeprecatediPhoneiPadmacOSsince 12.5.0

Deprecated since 13.0.0, removed in 13.0.0

This is handled by the operation system in newer versions of iOS.

A boolean indicating whether or not child windows of this tab group should have the ability to be swipe-to-closed over the full width of it's window or not.

Default: false

largeTitleEnabled

BooleaniPhoneiPadmacOSsince iPhone 6.3.0, iPad 6.3.0, macOS 9.2.0

Inherited from Titanium.UI.Window

A Boolean value indicating whether the title should be displayed in a large format.

Default: false

onBack

Callback<void>Android

Inherited from Titanium.UI.Window

Callback function that overrides the default behavior when the user presses the Back button.

rect

DimensionWithAbsolutessince 2.0.0read-only

Inherited from Titanium.UI.View

The bounding box of the view relative to its parent, in system units.

rotation

NumberAndroidiPhoneiPadsince Android 5.4.0, iPhone 12.3.0, iPad 12.3.0

Inherited from Titanium.UI.View

Clockwise 2D rotation of the view in degrees.

safeAreaPadding

Paddingsince Android 7.5.0, iPhone 8.0.0, iPad 8.0.0, macOS 9.2.0read-only

Inherited from Titanium.UI.Window

The padding needed to safely display content without it being overlapped by the screen insets and notches.

shiftMode

NumberAndroidsince 8.0.0

Determines whether the TABS_STYLE_BOTTOM_NAVIGATION uses shiftMode.

In Android BottomNavigationView uses shiftMode by default. This mode changes unselected tabs' properties - makes the title invisible and reduces the icon's dimensions by half.

This property allows the user to choose whether they would use this design behavior.

Default is 1 (true) to show title only when the tab is selected. Selected tab will be bigger. Set it to 0 (false) to show all titles and make the buttons the same size. Set it to 2 hide all titles and make the buttons the same size. Title stays hidden for active tabs.

NOTE: This property only affects TabGroups with the TABS_STYLE_BOTTOM_NAVIGATION.

Default: 1

smoothScrollOnTabClick

BooleanAndroidsince 3.6.0

Boolean value indicating if changing pages by tab clicks is animated.

If true, when clicking the tab the page transition is animated, false otherwise.

Default: true

splitActionBar

BooleandeprecatedAndroidsince 3.6.0

Inherited from Titanium.UI.Window

Deprecated since 6.2.0

Deprecated in AppCompat theme. The same behaviour can be achieved by using Toolbar.

Boolean value to enable split action bar.

statusBarColor

NumberAndroidsince 12.7.0

The color of the status bar (top bar) for this window.

Starting with Android 16 (target SDK 36), the status bar is always transparent as part of edge-to-edge enforcement, and statusBarColor is ignored by the system. On Android 16+, the status bar area will show the TabGroup's backgroundColor instead. Use backgroundColor to control the color behind the status bar on Android 16+.

style

NumberAndroidsince 8.0.0

Property defining which style for the TabGroup to be used.

Since 8.0.0 Titanium has introduce a new style to be used for the TabGroup component.

For backwards compatibility not taking advantage of this property results in using the default style which is similar to the ActionBar Tabs style but sticking to the Material design Guidelines.

TABS_STYLE_BOTTOM_DEFAULT is the style that was used in Titanium prior to 8.0.0.GA. It displays the TabGroup with a list of Tabs at the top of the screen.

TABS_STYLE_BOTTOM_NAVIGATION is a style that displays the TabGroup with a list of Tabs in a controller at the bottom of the screen. The recommended usage of this style is for items count between three and five: (https://material.io/design/components/bottom-navigation.html#usage) In Android it is limited to supporting a maximum number of five tabs. You can use paddingLeft, paddingRight, paddingBottom to create a floating bottom navigation. If you want to change the radius or background color you'll need to create /app/platform/android/res/drawable/titanium_rounded_corners.xml and set it to

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#FFFFFF" />
    <corners android:radius="7dp" />
</shape>

swipeable

BooleanAndroidsince 3.6.0

Boolean value indicating if tab navigation can be done by swipes, in addition to tab clicks.

On Android, the tabs may be selected by swipes, in addition to clicks. This property may be set at tab group creation, or any time later as long as the tab navigation is not disabled.

Default: true

swipeToClose

BooleaniPhoneiPadmacOSsince iPhone 5.2.0, iPad 5.2.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Boolean value indicating if the user should be able to close a window using a swipe gesture.

Default: true

tabBarVisible

Booleansince 12.1.0

Programmatically shows / hides the bottom tab group of the tab group.

This method also updates iOS 18+ Elevated Tab Bar on iPad. Notes: Animation effect is applied on iOS <= 17, but will be removed in SDK 13.0.0.

Default: true

Default background color for inactive tabs, as a color name or hex triplet.

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

A tab's backgroundColor property takes precedence if set.

This property applies to all states and tabs, not just inactive tabs. Furthermore, the inactive tab icons without activeIcon will be tinted this color.

tabsTintColor

String | Titanium.UI.ColordeprecatediPhoneiPadmacOSsince 3.1.3

Deprecated since 9.0.3

Deprecated in favor of Titanium.UI.TabGroup.tintColor or alternatively Titanium.UI.Tab.tintColor.

The tintColor to apply to the tabs.

This property is a direct correspondent of the tintColor property of UITabBar on iOS. This effects the title and icons rendered in the active tab. When not specified the active icons are tinted with a bright blue.

Default: null

tabsTranslucent

BooleaniPhoneiPadmacOSsince 6.2.0

A Boolean value that indicates whether the tab group is translucent.

When the value of this property is true, the tab group adds a translucent effect to its background image or tint color. When translucency is enabled, part of the tab group's underlying content is able to show through, although the amount that shows through depends on the rest of the tab group configuration. For example, a background image can wholly or partially obscure the background content. Setting this property to NO causes the tab group to render its bar tint color or background image on top of an opaque backdrop.

The default value of this property is dependent on the configuration of the tab group:

  • The default value is true when the tab group does not have a custom background image.
  • The default value is true when a custom background image contains any transparency - that is, at least one pixel has an alpha value of less than 1.0.
  • The default value is false when the custom background image is completely opaque - that is, all pixels have an alpha value of 1.0.

Default: true

tintColor

Stringsince 9.0.3

The tintColor to apply to tabs.

This property affects the tint of unselected tab icons.

Default: null

title

StringAndroidsince 3.3.0

Title for this tabGroup.

titleAttributes

titleAttributesParamsiPhoneiPadmacOSsince 3.3.0

Title text attributes of the window to be applied on the More tab.

Use this property to specify the color, font and shadow attributes of the title.

titleColor

String | Titanium.UI.Colorsince 9.0.3

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

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

titleImage

StringiPhoneiPadmacOS

Inherited from Titanium.UI.Window

Image to show in the title area of the nav bar, specified as a local file path or URL.

tooltip

Stringsince 12.1.0iOS 15.0+

Inherited from Titanium.UI.View

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

touchFeedback

BooleanAndroidsince 6.1.0

Inherited from Titanium.UI.View

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

Default: false

translationX

NumberAndroidsince 5.0.0

Inherited from Titanium.UI.View

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

translucent

BooleaniPhoneiPadmacOSsince 3.3.0

Boolean value indicating if the nav bar (typically for the More tab), is translucent.

Default: true on iOS 7 and above, false otherwise.

Methods 29

Inherited from Titanium.Proxy

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

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to invoke when the event is fired.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

addSharedElement

Androidsince 5.2.0Android 5+

Inherited from Titanium.UI.Window

Adds a common UI element to participate in window transition animation.

Parameters
ParametersTypeDescription
viewTitanium.UI.View

The shared view from the current window.

transitionNameString

The assigned common transition name of UI elements in both windows.

Closes the tab group and removes it from the UI.

convertPointToView

since Android 1.8, iPhone 1.8, iPad 1.8, macOS 9.2.0

Inherited from Titanium.UI.View

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

Parameters
ParametersTypeDescription
pointPoint

A 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.

destinationViewTitanium.UI.View

View that specifies the destination coordinate system to convert to. If this argument is not a view, an exception will be raised.

Returns Point

disableTabNavigation

deprecatedAndroidsince 3.6.0

Deprecated since 12.7.0

Disable (or re-enable) tab navigation. If tab navigation is disabled, the tabs are hidden and the last selected tab window is shown.

Parameters
ParametersTypeDescription
paramsdisableTabOptions

Boolean to disable tab navigation or dictionary (since 12.1.0).

2 fields
animated Boolean

Determines whether to use an animated effect to hide/show the navigation bar.

enabled Boolean

Show or hide the navigation bar.

Inherited from Titanium.Proxy

Fires a synthesized event to any registered listeners.

Parameters
ParametersTypeDescription
nameString

Name of the event.

event?Dictionary

A dictionary of keys and values to add to the Titanium.Event object sent to the listeners.

getActiveTab

deprecated

Deprecated since 10.0.0, removed in 10.0.0

Use the <Titanium.UI.TabGroup.activeTab> property instead.

Gets the currently-active tab.

getTabs

deprecated

Deprecated since 10.0.0, removed in 10.0.0

Use the <Titanium.UI.TabGroup.tabs> property instead.

Gets all tabs that are managed by the tab group.

Returns Array<Titanium.UI.Tab>

getViewById

since 6.1.0

Inherited from Titanium.UI.View

Returns the matching view of a given view ID.

Parameters
ParametersTypeDescription
idString

The ID of the view that should be returned. Use the id property in your views to enable it for indexing in this method.

Inherited from Titanium.UI.View

Hides this view.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Animation options for Android only. Since SDK 5.1.0 and used only on Android 5.0+

Determines whether to enable a circular reveal animation. Note that the default here is equivalent to passing in { animated: false }

hideNavBar

iPhoneiPadmacOS

Inherited from Titanium.UI.Window

Hides the navigation bar.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Options dictionary supporting a single animated boolean property to determine whether the navigation bar will be animated (default) while being hidden. Note that the default here is equivalent to { animated: true }

hideToolbar

iPhoneiPadmacOSsince iPhone 5.4.0, iPad 5.4.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Makes the bottom toolbar invisible.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Options dictionary supporting a single animated boolean property to determine whether the toolbar will be animated (default) while being hidden. Note that the default here is equivalent to { animated: true }

insertAt

since 3.3.0

Inherited from Titanium.UI.View

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

Parameters
ParametersTypeDescription
paramsViewPositionOptions

Pass an object that specifies the view to insert and optionally at which position (defaults to end)

2 fields
position? Number

Position in the children array of the view element to replace.

view Titanium.UI.View

View to insert. Required.

Opens the tab group and makes it visible.

Inherited from Titanium.Proxy

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

Parameters
ParametersTypeDescription
nameString

Name of the event.

callbackCallback<Titanium.Event>

Callback function to remove. Must be the same function passed to addEventListener.

4 fields
bubbles Boolean

True if the event will try to bubble up if possible.

cancelBubble Boolean

Set to true to stop the event from bubbling.

source Object

Source object that fired the event.

type String

Name of the event fired.

removeTab

iPhoneiPadmacOS

Removes a tab from the tab group.

Parameters
ParametersTypeDescription
tabTitanium.UI.Tab

Tab to remove.

setActiveTab

deprecated

Deprecated since 10.0.0, removed in 10.0.0

Use the <Titanium.UI.TabGroup.activeTab> property instead.

Selects the currently active tab in a tab group.

Parameters
ParametersTypeDescription
indexOrObjectNumber | Titanium.UI.Tab

Index or object of the tab to switch to.

Inherited from Titanium.UI.View

Makes this view visible.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Animation options for Android only. Since SDK 5.1.0 and only used on Android 5.0+

Determines whether to enable a circular reveal animation. Note that the default here is equivalent to passing in { animated: false }

showNavBar

iPhoneiPadmacOS

Inherited from Titanium.UI.Window

Makes the navigation bar visible.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Options dictionary supporting a single animated boolean property to determine whether the navigation bar will be animated (default) while being shown. Note that the default here is equivalent to { animated: true }

showToolbar

iPhoneiPadmacOSsince iPhone 5.4.0, iPad 5.4.0, macOS 9.2.0

Inherited from Titanium.UI.Window

Makes the bottom toolbar visible.

Parameters
ParametersTypeDescription
options?AnimatedOptions

Options dictionary supporting a single animated boolean property to determine whether the toolbar will be animated (default) while being shown. Note that the default here is equivalent to { animated: true }

Inherited from Titanium.UI.View

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

Parameters
ParametersTypeDescription
callback?Callback<Titanium.Blob>

Function to be invoked upon completion. If non-null, this method will be performed asynchronously. If null, it will be performed immediately.

honorScaleFactor?Boolean

Determines 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.

Events 11

androidback

Androidsince 3.0.0

Fired when the back button is pressed by the user.

This event is fired when the current tab group's activity detects a back button press by the user to navigate back.

By default this event would trigger the current activity to be finished and removed from the task stack. Subscribing to this event with a listener will prevent the default behavior. To finish the activity from your listener just call the close method of the tab group.

androidcamera

Androidsince 3.0.0

Fired when the Camera button is released.

Setting a listener disables the default key handling for this button. To restore default behavior, remove the listener.

androidfocus

Androidsince 3.0.0

Fired when the Camera button is half-pressed then released.

Setting a listener disables the default key handling for this button. To restore default behavior, remove the listener.

androidsearch

Androidsince 3.0.0

Fired when the Search button is released.

Setting a listener disables the default key handling for this button. To restore default behavior, remove the listener.

androidvoldown

Androidsince 3.0.0

Fired when the volume down button is released.

Setting a listener disables the default key handling for this button. To restore default behavior, remove the listener.

androidvolup

Androidsince 3.0.0

Fired when the volume up button is released.

Setting a listener disables the default key handling for this button. To restore default behavior, remove the listener.

Fired when this tab group loses focus. On Android, fired when a tab in this tab group loses focus.

On Android, this event also fires before putting the activity in the background (before the activity enters the pause state).

Event properties
Event propertiesTypeDescription
indexNumber

Index of the current active tab. On iOS, a value of undefined indicates that the More tab was the active tab.

previousIndexNumber

Index of the previous active tab. On iOS, a value of undefined indicates that the More tab was the previous tab.

tabTitanium.UI.Tab

Active tab.

previousTabTitanium.UI.Tab

Previous active tab. On iOS, a value of undefined indicates that the More tab was the previous tab.

close

since 7.1.0

Fired when the tab group is closed.

Fired when this tab group gains focus. On Android, fired when a tab in this tab group gains focus.

On Android, this event also fires when the activity enters the foreground (after the activity enters the resume state).

Event properties
Event propertiesTypeDescription
indexNumber

Index of the current active tab.

previousIndexNumber

Index of the previous active tab.

tabTitanium.UI.Tab

Active tab.

previousTabTitanium.UI.Tab

Previous active tab.

Fired when the tab group is opened.

rotate

since 12.7.0

Inherited from Titanium.UI.View

Fired when the device detects a two finger rotation.

Event properties
Event propertiesTypeDescription
rotateNumber

Rotation in degrees.