You are reading 12.6.1. See this page in 13.4.1.
Titanium.UI.TabGroup
Extends Titanium.UI.WindowTitanium.UI.ViewTitanium.Proxy
A tabbed group of windows.
| Android | iOS |
|---|---|
![]() |
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'll have to create a file
/app/platform/android/res/values/dimens.xmland add to fix the height of the menu:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="design_bottom_navigation_height">80dp</dimen>
</resources>
-
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 useaddTabandsetActiveTabinstead. -
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();
Properties 127
Inherited from Titanium.UI.View
Boolean value to remove the long press notification for the device's accessibility service.
Default: true
activeTab
Number | Titanium.UI.TabActive tab.
Default background image for the active tab.
Deprecated since 9.0.3
Deprecated in favor of Titanium.UI.TabGroup.activeTintColor or alternatively Titanium.UI.Tab.activeTintColor.
Color applied to active tabs icons, as a color name or hex triplet, where the tab's activeIcon was not defined.
For information about color values, see the "Colors" section of Titanium.UI.
The activeTintColor to apply to tabs.
This property affects the tint of selected tab icons.
Default: null
Defines the color of the title of tab when it's active.
The color of the title of the tab when it's active.
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.
Inherited from Titanium.UI.Window
The type of transition used when activity is entering.
Default: If not specified uses platform theme transition.
Inherited from Titanium.UI.Window
The type of transition used when activity is exiting.
Default: If not specified uses platform theme transition.
Inherited from Titanium.UI.Window
The type of transition used when reentering to a previously started activity.
Default: If not specified uses `activityExitTransition`.
Inherited from Titanium.UI.Window
The type of transition used when returning from a previously started activity.
Default: If not specified uses `activityEnterTransition`.
Inherited from Titanium.UI.Window
The type of enter transition used when animating shared elements between two activities.
Default: Defaults to android platform's [move](https://github.com/android/platform_frameworks_base/blob/lollipop-release/core/res/res/transition/move.xml) transition.
Inherited from Titanium.UI.Window
The type of exit transition used when animating shared elements between two activities.
Default: Defaults to android platform's [move](https://github.com/android/platform_frameworks_base/blob/lollipop-release/core/res/res/transition/move.xml) transition.
Inherited from Titanium.UI.Window
The type of reenter transition used when animating shared elements between two activities.
Default: Defaults to android platform's [move](https://github.com/android/platform_frameworks_base/blob/lollipop-release/core/res/res/transition/move.xml) transition.
Inherited from Titanium.UI.Window
The type of return transition used when animating shared elements between two activities.
Default: Defaults to android platform's [move](https://github.com/android/platform_frameworks_base/blob/lollipop-release/core/res/res/transition/move.xml) transition.
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
Inherited from Titanium.Proxy
The name of the API that this proxy corresponds to.
Inherited from Titanium.UI.Window
Specifies whether or not the view controller should automatically adjust its scroll view insets.
If set to true it will automatically set the actionbar title to the current tabs window title.
Default: false
Inherited from Titanium.UI.Window
Title for the back button. This is only valid when the window is a child of a tab.
Inherited from Titanium.UI.Window
The image to show as the back button. This is only valid when the window is a child of a tab.
backgroundColor
String | Titanium.UI.ColorInherited from Titanium.UI.Window
Background color of the window, as a color name or hex triplet.
Default: Transparent
barColor
String | Titanium.UI.ColorDefault 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.
Inherited from Titanium.UI.Window
Background image for the nav bar, specified as a URL to a local image.
Inherited from Titanium.Proxy
Indicates if the proxy will bubble an event to its parent.
Default: true
Inherited from Titanium.UI.View
View's center position, in the parent view's coordinates.
Inherited from Titanium.UI.View
View's clipping behavior.
Inherited from Titanium.UI.Window
Determines whether this Window is closed.
Default: true
Title for the edit button on the More tab.
Inherited from Titanium.UI.View
Base elevation of the view relative to its parent in pixels.
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.
Inherited from Titanium.UI.Window
An array of supported values specified using the EXTEND_EDGE constants in Titanium.UI.
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.
Inherited from Titanium.UI.View
Discards touch related events if another app's system overlay covers the view.
Default: false
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
Inherited from Titanium.UI.Window
Determines whether this TextArea has focus.
Default: false
fullscreen
BooleanInherited from Titanium.UI.Window
Boolean value indicating if the window is fullscreen.
Default: false
Inherited from Titanium.UI.Window
Set this to true to hide the back button of navigation bar.
Default: false
Inherited from Titanium.UI.Window
Set this to true to hide the navigation bar on swipe.
Default: false
Inherited from Titanium.UI.Window
Set this to true to hide the navigation bar on tap.
Default: false
Inherited from Titanium.UI.Window
Set this to true to hide the navigation bar when the keyboard appears.
Default: false
Inherited from Titanium.UI.Window
Set this to true to hide the shadow image of the navigation bar.
Default: false
Inherited from Titanium.UI.Window
A Boolean value indicating whether the integrated search bar is hidden when scrolling any underlying content.
Default: true
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
Inherited from Titanium.UI.View
Adds a horizontal parallax effect to the view
id
StringInherited from Titanium.UI.View
View's identifier.
Inherited from Titanium.UI.Window
Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar).
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
Inherited from Titanium.UI.View
Determines whether to keep the device screen on.
Default: false
Inherited from Titanium.UI.Window
The mode to use when displaying the title of the navigation bar.
Default: Titanium.UI.iOS.LARGE_TITLE_DISPLAY_MODE_AUTOMATIC
Inherited from Titanium.UI.Window
A Boolean value indicating whether the title should be displayed in a large format.
Default: false
Inherited from Titanium.UI.Window
View to show in the left nav bar area.
Inherited from Titanium.UI.Window
An Array of views to show in the left nav bar area.
Inherited from Titanium.Proxy
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
modal
BooleanInherited from Titanium.UI.Window
Indicates to open a modal window or not.
Default: false
navBarHidden
BooleanInherited from Titanium.UI.Window
Hides the navigation bar (true) or shows the navigation bar (false).
Default: false
navigationWindow
Titanium.UI.NavigationWindowiPhoneiPadmacOSsince iPhone 7.3.0, iPad 7.3.0, macOS 9.2.0read-onlyInherited from Titanium.UI.Window
The Titanium.UI.NavigationWindow instance hosting this window.
The tintColor to apply to the navigation bar (typically for the More tab).
This property is a direct correspondant of the tintColor property of NavigationBar on iOS.
Default: null
Inherited from Titanium.UI.Window
Callback function that overrides the default behavior when the user presses the Back button.
Inherited from Titanium.UI.Window
Current orientation of the window.
orientationModes
Array<Number>Inherited from Titanium.UI.Window
Array of supported orientation modes, specified using the orientation constants defined in Titanium.UI.
Default: empty array
Inherited from Titanium.UI.View
When on, animate call overrides current animation if applicable.
Bottom padding of bottom navigation
When using TABS_STYLE_BOTTOM_NAVIGATION you can set the padding to have a floating bottom navigation
Left padding of bottom navigation
When using TABS_STYLE_BOTTOM_NAVIGATION you can set the padding to have a floating bottom navigation
Right padding of bottom navigation
When using TABS_STYLE_BOTTOM_NAVIGATION you can set the padding to have a floating bottom navigation
Inherited from Titanium.UI.View
The preview context used in the 3D-Touch feature "Peek and Pop".
Inherited from Titanium.UI.View
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.
Inherited from Titanium.UI.View
The bounding box of the view relative to its parent, in system units.
Inherited from Titanium.UI.Window
View to show in the right nav bar area.
Inherited from Titanium.UI.Window
An Array of views to show in the right nav bar area.
Inherited from Titanium.UI.View
Clockwise 2D rotation of the view in degrees.
Inherited from Titanium.UI.View
Clockwise rotation of the view in degrees (x-axis).
Inherited from Titanium.UI.View
Clockwise rotation of the view in degrees (y-axis).
Inherited from Titanium.UI.Window
The padding needed to safely display content without it being overlapped by the screen insets and notches.
Inherited from Titanium.UI.View
Scaling of the view in x-axis in pixels.
Inherited from Titanium.UI.View
Scaling of the view in y-axis in pixels.
Image of the shadow placed between the tab bar and the content area.
The Titanium.UI.TabGroup.tabsBackgroundImage property must also be set in order for this to take effect.
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
Inherited from Titanium.UI.View
The size of the view in system units.
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
Inherited from Titanium.UI.Window
Deprecated since 6.2.0
Deprecated in AppCompat theme. The same behaviour can be achived by using Toolbar.
Boolean value to enable split action bar.
Inherited from Titanium.UI.Window
The color of the status bar (top bar) for this window.
Inherited from Titanium.UI.Window
The status bar style associated with this window.
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>
Inherited from Titanium.UI.Window
Maintain a sustainable level of performance.
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
Inherited from Titanium.UI.Window
Boolean value indicating if the user should be able to close a window using a swipe gesture.
Default: true
Inherited from Titanium.UI.Window
Boolean value indicating if the tab bar should be hidden.
Programmatically shows / hides the bottom tab bar of the tab group.
Property defining which tabMode is used for the TabGroup.
Sets the style of the TabGroup tabs.
TAB_MODE_SCROLLABLE is the best style for showing long tab titles and enables horizontal scrolling (default).
TAB_MODE_FIXED will show all tabs at once.
tabs
Array<Titanium.UI.Tab>Tabs managed by the tab group.
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.
Default background image for tabs.
Default background selected color for tabs, as a color name or hex triplet.
For information about color values, see the "Colors" section of Titanium.UI.
This property is only supported by TABS_STYLE_BOTTOM_NAVIGATION.
A tab's backgroundFocusedColor property takes precedence if set.
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 correspondant 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
A Boolean value that indicates whether the tab bar 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 bar's underlying content is able
to show through, although the amount that shows through depends on the rest of the tab bar configuration.
For example, a background image can wholly or partially obscure the background content. Setting this
property to NO causes the tab bar 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 bar:
- The default value is
truewhen the tab bar does not have a custom background image. - The default value is
truewhen 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
falsewhen the custom background image is completely opaque - that is, all pixels have an alpha value of 1.0.
Default: true
Inherited from Titanium.UI.Window
Name of the theme to apply to the window.
The tintColor to apply to tabs.
This property affects the tint of unselected tab icons.
Default: null
Title for this tabGroup.
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.
Defines the color of the title of tab when it's inactive.
The color of the title of the tab when it's inactive.
Inherited from Titanium.UI.Window
View to show in the title area of the nav bar.
titleid
StringInherited from Titanium.UI.Window
Key identifying a string from the locale file to use for the window title.
Inherited from Titanium.UI.Window
Image to show in the title area of the nav bar, specified as a local file path or URL.
Inherited from Titanium.UI.Window
Title prompt for the window.
Inherited from Titanium.UI.Window
Key identifying a string from the locale file to use for the window title prompt.
Inherited from Titanium.UI.Window
Array of button objects to show in the window's toolbar.
Inherited from Titanium.UI.View
The default text to display in the control's tooltip.
touchEnabled
BooleanInherited from Titanium.UI.View
Determines whether view should receive touch events.
Default: true
Inherited from Titanium.UI.View
A material design visual construct that provides an instantaneous visual confirmation of touch point.
Default: false
Inherited from Titanium.UI.View
Optional touch feedback ripple color. This has no effect unless touchFeedback is true.
Inherited from Titanium.UI.Window
Use a transition animation when opening or closing windows in a Titanium.UI.NavigationWindow or Titanium.UI.Tab.
Inherited from Titanium.UI.View
A name to identify this view in activity transition.
Inherited from Titanium.UI.View
Horizontal location of the view relative to its left position in pixels.
Inherited from Titanium.UI.View
Vertical location of the view relative to its top position in pixels.
Inherited from Titanium.UI.View
Depth of the view relative to its elevation in pixels.
Boolean value indicating if the nav bar (typically for the More tab), is translucent.
Default: true on iOS7 and above, false otherwise.
Deprecated since 9.0.3
Deprecated in favor of Titanium.UI.TabGroup.tintColor or alternatively Titanium.UI.Tab.tintColor.
Unselected items in this tab group will be tinted with this color. Setting this value to null indicates that the tab group should use its default value instead.
For information about color values, see the "Colors" section of Titanium.UI.
Inherited from Titanium.UI.View
Adds a vertical parallax effect to the view
viewShadowColor
String | Titanium.UI.Colorsince Android 11.1.0, iPhone 3.3.0, iPad 3.3.0, macOS 9.2.0Inherited from Titanium.UI.View
Determines the color of the shadow.
Inherited from Titanium.UI.View
Determines the offset for the shadow of the view.
Inherited from Titanium.UI.View
Determines the blur radius used to create the shadow.
visible
BooleanInherited from Titanium.UI.View
Determines whether the view is visible.
Default: true
Inherited from Titanium.UI.Window
Additional flags to set on the Activity Window.
Inherited from Titanium.UI.Window
Set the pixel format for the Activity's Window.
Accepts 14 constants
Determines how the tab group is treated when a soft input method (such as a virtual keyboard) is displayed.
For more information see the official Android API Reference, Window.setSoftInputMode.
Methods 28
Inherited from Titanium.Proxy
Adds the specified callback as an event listener for the named event.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| callback | Callback<Titanium.Event> | Callback function to invoke when the event is fired. 4 fields
|
Inherited from Titanium.UI.Window
Adds a common UI element to participate in window transition animation.
| Parameters | Type | Description |
|---|---|---|
| view | Titanium.UI.View | The shared view from the current window. |
| transitionName | String | The assigned common transition name of UI elements in both windows. |
Adds a tab to the tab group.
| Parameters | Type | Description |
|---|---|---|
| tab | Titanium.UI.Tab | Tab to add. |
Inherited from Titanium.UI.View
Animates this view.
| Parameters | Type | Description |
|---|---|---|
| animation | Titanium.UI.Animation | Dictionary<Titanium.UI.Animation> | Either a dictionary of animation properties or an Animation object. |
| callback? | Callback<Object> | Function to be invoked upon completion of the animation. |
applyProperties
since 3.0.0Inherited from Titanium.Proxy
Applies the properties to the proxy.
| Parameters | Type | Description |
|---|---|---|
| props | Dictionary | A dictionary of properties to apply. |
Inherited from Titanium.UI.View
Removes all previously added motion effects.
Closes the tab group and removes it from the UI.
convertPointToView
since Android 1.8, iPhone 1.8, iPad 1.8, macOS 9.2.0Inherited from Titanium.UI.View
Translates a point from this view's coordinate system to another view's coordinate system.
| Parameters | Type | Description |
|---|---|---|
| point | Point | A point in this view's coordinate system. If this argument is missing an |
| destinationView | Titanium.UI.View | View that specifies the destination coordinate system to convert to. If this argument is not a view, an exception will be raised. |
Disable (or re-enable) tab navigation. If tab navigation is disabled, the tabs are hidden and the last selected tab window is shown.
| Parameters | Type | Description |
|---|---|---|
| params | disableTabOptions | Boolean to disable tab navigation or dictionary (since 12.1.0). 2 fields
|
Inherited from Titanium.Proxy
Fires a synthesized event to any registered listeners.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| event? | Dictionary | A dictionary of keys and values to add to the Titanium.Event object sent to the listeners. |
getActiveTab
deprecatedDeprecated since 10.0.0, removed in 10.0.0
Use the <Titanium.UI.TabGroup.activeTab> property instead.
Gets the currently-active tab.
getTabs
deprecatedDeprecated 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.
getViewById
since 6.1.0Inherited from Titanium.UI.View
Returns the matching view of a given view ID.
| Parameters | Type | Description |
|---|---|---|
| id | String | The ID of the view that should be returned. Use the |
Inherited from Titanium.UI.View
Hides this view.
| Parameters | Type | Description |
|---|---|---|
| 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 |
hideNavBar
iPhoneiPadmacOSInherited from Titanium.UI.Window
Hides the navigation bar.
| Parameters | Type | Description |
|---|---|---|
| options? | AnimatedOptions | Options dictionary supporting a single |
hideTabBar
iPhoneiPadmacOSInherited from Titanium.UI.Window
Hides the tab bar. Must be called before opening the window.
Inherited from Titanium.UI.Window
Makes the bottom toolbar invisible.
| Parameters | Type | Description |
|---|---|---|
| options? | AnimatedOptions | Options dictionary supporting a single |
insertAt
since 3.3.0Inherited from Titanium.UI.View
Inserts a view at the specified position in the children array.
| Parameters | Type | Description |
|---|---|---|
| params | ViewPositionOptions | Pass an object that specifies the view to insert and optionally at which position (defaults to end) 2 fields
|
Opens the tab group and makes it visible.
Inherited from Titanium.UI.Window
Clears all added shared elements.
Inherited from Titanium.Proxy
Removes the specified callback as an event listener for the named event.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| callback | Callback<Titanium.Event> | Callback function to remove. Must be the same function passed to 4 fields
|
removeTab
iPhoneiPadmacOSRemoves a tab from the tab group.
| Parameters | Type | Description |
|---|---|---|
| tab | Titanium.UI.Tab | Tab to remove. |
setActiveTab
deprecatedDeprecated 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 | Type | Description |
|---|---|---|
| indexOrObject | Number | Titanium.UI.Tab | Index or object of the tab to switch to. |
Inherited from Titanium.UI.View
Makes this view visible.
| Parameters | Type | Description |
|---|---|---|
| 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 |
showNavBar
iPhoneiPadmacOSInherited from Titanium.UI.Window
Makes the navigation bar visible.
| Parameters | Type | Description |
|---|---|---|
| options? | AnimatedOptions | Options dictionary supporting a single |
Inherited from Titanium.UI.Window
Makes the bottom toolbar visible.
| Parameters | Type | Description |
|---|---|---|
| options? | AnimatedOptions | Options dictionary supporting a single |
Inherited from Titanium.UI.View
Stops a running animation.
Inherited from Titanium.UI.View
Returns an image of the rendered view, as a Blob.
| Parameters | Type | Description |
|---|---|---|
| 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 10
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.
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.
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.
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.
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.
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 | Type | Description |
|---|---|---|
| index | Number | Index of the current active tab. On iOS, a value of |
| previousIndex | Number | Index of the previous active tab. On iOS, a value of |
| tab | Titanium.UI.Tab | Active tab. |
| previousTab | Titanium.UI.Tab | Previous active tab. On iOS, a value of |
close
since 7.1.0Fired 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 | Type | Description |
|---|---|---|
| index | Number | Index of the current active tab. |
| previousIndex | Number | Index of the previous active tab. |
| tab | Titanium.UI.Tab | Active tab. |
| previousTab | Titanium.UI.Tab | Previous active tab. |
Fired when the tab group is opened.
