Titanium.UI.iPad.SplitWindow

Object of Titanium.UI.iPad.
Platform Since
iPad 1.2

Summary

A SplitWindow is a window that manages the presentation of two side-by-side view controllers.

Description

You use this class to implement a master-detail interface, in which the left-side view presents a list of items and the right-side presents details of the selected item. The SplitView is for use exclusively on iPad devices.

By default, the SplitView shows both master and detail views in landscape orientation. When the device switches into portrait orientation, the detail view occupies the entire screen. The user can click a button to bring up the master view as floating, "popover" view. (To show the master view in both orientations, set showMasterInPortrait to true.)

Use the Titanium.UI.iPad.createSplitWindow method to create a SplitWindow. The masterView and detailView properties are required in the constructor of the SplitWindow and cannot be changed once set.

The SplitWindow inherits its methods and properties from Titanium.UI.Window.

The SplitWindow is a top-level window and cannot be contained within another window or view. splitview

Code Examples

Split Window Example

This is an example of a Split Window.

var win = Ti.UI.createWindow();
 
var nav = Ti.UI.iPhone.createNavigationGroup({
   window: win
});
 
var splitwin = Ti.UI.iPad.createSplitWindow({
    detailView:nav,
    masterView:masterView
});
 
splitwin.addEventListener('visible',function(e)
{
    if (e.view == 'detail')
    {
        e.button.title = "Master";
        win.leftNavButton = e.button;
    }
    else if (e.view == 'master')
    {
        win.leftNavButton = null;
    }
});
 
splitwin.open();

Methods

Name Summary
add

Adds a child to this view's hierarchy.

addEventListener

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

animate

Animates this view.

close

Closes the window.

convertPointToView

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

fireEvent

Fires a synthesized event to any registered listeners.

getActivity

Gets the value of the activity property.

getAnchorPoint

Gets the value of the anchorPoint property.

getAnimatedCenterPoint

Gets the value of the animatedCenterPoint property.

getBackButtonTitle

Gets the value of the backButtonTitle property.

getBackButtonTitleImage

Gets the value of the backButtonTitleImage property.

getBackgroundColor

Gets the value of the backgroundColor property.

getBackgroundDisabledColor

Gets the value of the backgroundDisabledColor property.

getBackgroundDisabledImage

Gets the value of the backgroundDisabledImage property.

getBackgroundFocusedColor

Gets the value of the backgroundFocusedColor property.

getBackgroundFocusedImage

Gets the value of the backgroundFocusedImage property.

getBackgroundGradient

Gets the value of the backgroundGradient property.

getBackgroundImage

Gets the value of the backgroundImage property.

getBackgroundLeftCap

Gets the value of the backgroundLeftCap property.

getBackgroundSelectedColor

Gets the value of the backgroundSelectedColor property.

getBackgroundSelectedImage

Gets the value of the backgroundSelectedImage property.

getBackgroundTopCap

Gets the value of the backgroundTopCap property.

getBarColor

Gets the value of the barColor property.

getBarImage

Gets the value of the barImage property.

getBorderColor

Gets the value of the borderColor property.

getBorderRadius

Gets the value of the borderRadius property.

getBorderWidth

Gets the value of the borderWidth property.

getBottom

Gets the value of the bottom property.

getCenter

Gets the value of the center property.

getDetailView

Gets the value of the detailView property.

getExitOnClose

Gets the value of the exitOnClose property.

getFocusable

Gets the value of the focusable property.

getFullscreen

Gets the value of the fullscreen property.

getHeight

Gets the value of the height property.

getKeepScreenOn

Gets the value of the keepScreenOn property.

getLayout

Gets the value of the layout property.

getLeft

Gets the value of the left property.

getLeftNavButton

Gets the value of the leftNavButton property.

getMasterView

Gets the value of the masterView property.

getModal

Gets the value of the modal property.

getNavBarHidden

Gets the value of the navBarHidden property.

getOpacity

Gets the value of the opacity property.

getOrientation

Gets the value of the orientation property.

getOrientationModes

Gets the value of the orientationModes property.

getRight

Gets the value of the right property.

getRightNavButton

Gets the value of the rightNavButton property.

getShowMasterInPortrait

Gets the value of the showMasterInPortrait property.

getSize

Gets the value of the size property.

getSoftKeyboardOnFocus

Gets the value of the softKeyboardOnFocus property.

getTabBarHidden

Gets the value of the tabBarHidden property.

getTitle

Gets the value of the title property.

getTitleControl

Gets the value of the titleControl property.

getTitleImage

Gets the value of the titleImage property.

getTitlePrompt

Gets the value of the titlePrompt property.

getTitleid

Gets the value of the titleid property.

getTitlepromptid

Gets the value of the titlepromptid property.

getToolbar

Gets the value of the toolbar property.

getTop

Gets the value of the top property.

getTouchEnabled

Gets the value of the touchEnabled property.

getTransform

Gets the value of the transform property.

getTranslucent

Gets the value of the translucent property.

getUrl

Gets the value of the url property.

getVisible

Gets the value of the visible property.

getWidth

Gets the value of the width property.

getWindowPixelFormat

Gets the value of the windowPixelFormat property.

getWindowSoftInputMode

Gets the value of the windowSoftInputMode property.

getZIndex

Gets the value of the zIndex property.

hide

Hides this view.

hideTabBar

Hides the tab bar. Must be called before opening the window.

open

Opens the window.

remove

Removes a child view from this view's hierarchy.

removeEventListener

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

setActivity

Sets the value of the activity property.

setAnchorPoint

Sets the value of the anchorPoint property.

setBackButtonTitle

Sets the value of the backButtonTitle property.

setBackButtonTitleImage

Sets the value of the backButtonTitleImage property.

setBackgroundColor

Sets the value of the backgroundColor property.

setBackgroundDisabledColor

Sets the value of the backgroundDisabledColor property.

setBackgroundDisabledImage

Sets the value of the backgroundDisabledImage property.

setBackgroundFocusedColor

Sets the value of the backgroundFocusedColor property.

setBackgroundFocusedImage

Sets the value of the backgroundFocusedImage property.

setBackgroundGradient

Sets the value of the backgroundGradient property.

setBackgroundImage

Sets the value of the backgroundImage property.

setBackgroundLeftCap

Sets the value of the backgroundLeftCap property.

setBackgroundSelectedColor

Sets the value of the backgroundSelectedColor property.

setBackgroundSelectedImage

Sets the value of the backgroundSelectedImage property.

setBackgroundTopCap

Sets the value of the backgroundTopCap property.

setBarColor

Sets the value of the barColor property.

setBarImage

Sets the value of the barImage property.

setBorderColor

Sets the value of the borderColor property.

setBorderRadius

Sets the value of the borderRadius property.

setBorderWidth

Sets the value of the borderWidth property.

setBottom

Sets the value of the bottom property.

setCenter

Sets the value of the center property.

setFocusable

Sets the value of the focusable property.

setFullscreen

Sets the value of the fullscreen property.

setHeight

Sets the value of the height property.

setKeepScreenOn

Sets the value of the keepScreenOn property.

setLayout

Sets the value of the layout property.

setLeft

Sets the value of the left property.

setLeftNavButton

Sets the value of the leftNavButton property.

setModal

Sets the value of the modal property.

setNavBarHidden

Sets the value of the navBarHidden property.

setOpacity

Sets the value of the opacity property.

setOrientation

Sets the value of the orientation property.

setOrientationModes

Sets the value of the orientationModes property.

setRight

Sets the value of the right property.

setRightNavButton

Sets the value of the rightNavButton property.

setShowMasterInPortrait

Sets the value of the showMasterInPortrait property.

setSize

Sets the value of the size property.

setSoftKeyboardOnFocus

Sets the value of the softKeyboardOnFocus property.

setTabBarHidden

Sets the value of the tabBarHidden property.

setTitle

Sets the value of the title property.

setTitleControl

Sets the value of the titleControl property.

setTitleImage

Sets the value of the titleImage property.

setTitlePrompt

Sets the value of the titlePrompt property.

setTitleid

Sets the value of the titleid property.

setTitlepromptid

Sets the value of the titlepromptid property.

setToolbar

Sets the value of the toolbar property.

setTop

Sets the value of the top property.

setTouchEnabled

Sets the value of the touchEnabled property.

setTransform

Sets the value of the transform property.

setTranslucent

Sets the value of the translucent property.

setVisible

Sets the value of the visible property.

setWidth

Sets the value of the width property.

setWindowPixelFormat

Sets the value of the windowPixelFormat property.

setZIndex

Sets the value of the zIndex property.

show

Makes this view visible.

toImage

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

Properties

Name Type Summary
activity Titanium.Android.Activity

For heavyweight windows, this property contains a reference to the Android Activity object associated with this window.

anchorPoint Point

Anchor point where animation should occur, relative to the view's boundaries.

animatedCenterPoint Point

Current position of the view during an animation. read-only

backButtonTitle String

Title for the back button. This is only valid when the window is a child of a tab.

backButtonTitleImage String

URL to an image to show as the back button. This is only valid when the window is a child of a tab.

backgroundColor String

Background color of the view.

backgroundDisabledColor String

Disabled background color of the view.

backgroundDisabledImage String

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

backgroundFocusedColor String

Focused background color of the view.

backgroundFocusedImage String

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

backgroundGradient Gradient

A background gradient for the view.

backgroundImage String

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

backgroundLeftCap Number

Size of the left end cap.

backgroundSelectedColor String

Selected background color of the view.

backgroundSelectedImage String

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

backgroundTopCap Number

Size of the top end cap.

barColor String

Background color for the nav bar, specified as a hex color or color name.

barImage String

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

borderColor String

Border color of the view.

borderRadius Number

Border radius of the view.

borderWidth Number

Border width of the view.

bottom Number or String

View's bottom position, in platform-specific units.

center Point

View's center position, in the parent view's coordinates.

detailView Titanium.UI.View

View for the detail view section of the SplitWindow. creation

exitOnClose Boolean

Boolean value indicating if the application should exit when the Android Back button is pressed while the window is being shown. creation

focusable Boolean

Whether view should be focusable while navigating with the trackball.

fullscreen Boolean

Boolean value indicating if the window is fullscreen.

height Number or String

View height, in platform-specific units.

keepScreenOn Boolean

Whether to keep the device screen on.

layout String

Specifies how the view positions its children. One of: 'absolute', 'vertical', or 'horizontal'.

left Number or String

View's left position, in platform-specific units.

leftNavButton Titanium.UI.View

View to show in the left nav bar area.

masterView Titanium.UI.View

View for the master view section of the SplitWindow. creation

modal Boolean

Boolean to indicate if the window should be opened modal in front of other windows.

navBarHidden Boolean

For modal windows, hide the nav bar (true) or show the nav bar (false).

opacity Number

The opacity from 0.0-1.0.

orientation Number

Current orientation of the window.

orientationModes Array<Number>

Array of supported orientation modes, specified using the orientation constants defined in Titanium.UI.

right Number or String

View's right position, in platform-specific units.

rightNavButton Titanium.UI.View

View to show in the right nav bar area.

showMasterInPortrait Boolean

Whether or not to show the master view in portrait orientation.

size Object

Size of the view as a dictionary of width and height properties.

softKeyboardOnFocus Number

Determines keyboard behavior when this view is focused.

tabBarHidden Boolean

Boolean value indicating if the tab bar should be hidden.

title String

Title of the window.

titleControl Titanium.UI.View

View to show in the title area of the nav bar.

titleImage String

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

titlePrompt String

Title prompt for the window.

titleid String

Key identifying a string from the locale file to use for the window title.

titlepromptid String

Key identifying a string from the locale file to use for the window title prompt.

toolbar Array<Object>

Array of button objects to show in the window's toolbar. This is only valid when the window is the child of a tab.

top Number or String

The view's top position.

touchEnabled Boolean

Whether view should receive touch events.

transform Titanium.UI.2DMatrix or Titanium.UI.iOS.3DMatrix

Transformation matrix to apply to the view.

translucent Boolean

Boolean value indicating if the nav bar is translucent.

url String

Local URL to a JavaScript file with the windows instructions. creation

visible Boolean

Boolean value indicating whether the view is visible.

width Number or String

View's width, in platform-specific units.

windowPixelFormat Number

Set the pixel format for the Activity's Window.

windowSoftInputMode Number

Determines how the window is treated when a soft input method (such as a virtual keyboard) is displayed. creation

zIndex Number

Z index position relative to other sibling views.

Events

Name Summary
android:back

Fired when the Back button is released.

android:camera

Fired when the Camera button is released.

android:focus

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

android:search

Fired when the Search button is released.

android:voldown

Fired when the volume down button is released.

android:volup

Fired when the volume up button is released.

blur

Fired when the window loses focus.

click

Fired when the device detects a click against the view.

close

Fired when the window is closed.

dblclick

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

doubletap

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

focus

Fired when the window gains focus.

longclick

Fired when the device detects a long click.

longpress

Fired when the device detects a long press.

open

Fired when the window is opened.

pinch

Fired when the device detects a pinch gesture.

singletap

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

swipe

Fired when the device detects a swipe gesture (left or right) against the view.

touchcancel

Fired when a touch event is interrupted by the device.

touchend

Fired when a touch event is completed.

touchmove

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

touchstart

Fired as soon as the device detects a touch gesture.

twofingertap

Fired when the device detects a two-finger tap against the view.

visible

Fired when the masterView or detailView becomes visible.