Titanium.UI.WebView

> Titanium.UI.WebView

The web view allows you to open an HTML5 based view which can load either local or remote content.

Use the Titanium.UI.createWebView method or Alloy element to create a web view.

Web views are more expensive to create than other native views because of the requirement to load the HTML browser into memory.

The web view content can be any valid web content such as HTML, PDF, SVG or other WebKit supported content types.

JavaScript Context in WebViews--Local vs. Remote Content

JavaScript in the web view executes in its own context. The web view can interact with this content, but most of this functionality is limited to local content.

Local Scripts

When running local web content (that is, content that is included in the application's resources), scripts have access to the Titanium namespace. In particular, when running local web content:

Remote Scripts

Scripts downloaded from remote web servers cannot access the Titanium namespace.

To interact with remote content, wait until the content is loaded, then use the evalJS method to execute a JavaScript expression inside the web view and retrieve the value of an expression.

Local JavaScript Files

During the build process for creating a package, all JavaScript files, that is, any file with a '.js' extension, are removed and their content is encrypted and obfuscated into one resource, causing these files to not load properly in a WebView if they are loaded externally.

For JavaScript files referenced in static local HTML files, these JavaScript files are omitted from processing and left intact, which means they can be correctly loaded in the WebView.

For local JavaScript files not referenced in static local HTML files, for example, a dynamically-genereated HTML file referencing a local JavaScript file, rename the file extension of the local JavaScript files to '.jslocal' instead of '.js'.

The build process for testing your application on the simulator, emulator or device does not affect the loading of local JavaScript files.

iOS Platform Implementation Notes

On the iOS platform, the native web view handles scrolling and other related touch events internally. If you add event listeners on the web view or its parent views for any of the standard touch events (touchstart, click, and so on), these events do not reach the native web view, and the user will not be able to scroll, zoom, click on links, and so on. To prevent this default behavior, set willHandleTouches to false.

In other words, you can have either Titanium-style events against the web view instance, or internal JavaScript events in the DOM, but not both.

Android Platform Implementation Notes

Android 4.4 and Later Support

Starting with Android 4.4 (API Level 19), the WebView component is based off of Chromium, introducing a number of changes to its rendering engine. Web content may look or behave differently depending on the Android version. The WebView does not have full feature parity with Chrome for Android.

By default, the Chromium WebView uses hardware acceleration, which may cause content to fail to render. If the WebView fails to render the content, the web view will clear itself, displaying only the default background color. The following log messages will be displayed in the console:

[WARN] :   AwContents: nativeOnDraw failed; clearing to background color.
[INFO] :   chromium: [INFO:async_pixel_transfer_manager_android.cc(56)]

To workaround this issue, you can enable software rendering by setting the WebView's borderRadius property to a value greater than zero.

If you are developing local HTML content and size your elements using percentages, the WebView may not calculate the sizes correctly when hardware acceleration is enabled, resulting in the same behavior previously mentioned.

To workaround this issue, you can use the previously mentioned workaround to enable software rendering, use absolute size values or use the onresize event to set the heights of the components. For example, if you have a div element with an id set to component that needs to use the entire web view, the following callback resizes the content to use the full height of the web view:

window.onresize= function(){
    document.getElementById("component").style.height = window.innerHeight + 'px';
};

For more information, see the following topics:

Plugin Support

The Android web view supports native plugins such as Flash Player. Note that the Chromium-based web view introduced in Android 4.4 does not support the Flash Player plugin.

To use plugin content, you must set the pluginState property to either WEBVIEW_PLUGINS_ON or WEBVIEW_PLUGINS_ON_DEMAND.

You must also call pause when the current activity is paused, to prevent plugin content from continuing to run in the background. Call resume when the current activity is resumed. You can do this by adding listeners for the Activity.pause and Activity.resume events.

Accessing Cookies

On Android, the web view uses the system cookie store which does not share cookies with the Titanium.Network.HTTPClient cookie store. Developers can manage their cookies for both cookie stores using the methods Titanium.Network.addHTTPCookie, Titanium.Network.addSystemCookie, Titanium.Network.getHTTPCookies, Titanium.Network.getHTTPCookiesForDomain, Titanium.Network.getSystemCookies, Titanium.Network.removeHTTPCookie, Titanium.Network.removeHTTPCookiesForDomain, Titanium.Network.removeAllHTTPCookies, Titanium.Network.removeSystemCookie, Titanium.Network.removeAllSystemCookies.

For More Information

See Integrating Web Content in the Titanium Mobile Guides for more information on using web views, including use cases, more code examples, and best practices for web view content.

Examples

Basic Web View to External URL

Create a web view to a remote URL and open the window as modal.

  var webview = Titanium.UI.createWebView({url:'http://www.appcelerator.com'});
    var window = Titanium.UI.createWindow();
    window.add(webview);
    window.open({modal:true});

Alloy XML Markup

Previous example as an Alloy view.

<Alloy>
    <Window id="win" modal="true">
        <WebView id="webview" url="http://www.appcelerator.com" />
    </Window>
</Alloy>

  • 0.8
  • 3.1.2
  • 0.8
  • 0.8
  • 1.8
  • 3.1
Defined By

Properties

Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. ...

Whether the view should be "hidden" from (i.e., ignored by) the accessibility service.

On iOS this is a direct analog of the accessibilityElementsHidden property defined in the UIAccessibility Protocol. The native property is only available in iOS 5.0 and later; if accessibilityHidden is specified on earlier versions of iOS, it is ignored.

On Android, setting accessibilityHidden calls the native View.setImportantForAccessibility method. The native method is only available in Android 4.1 (API level 16/Jelly Bean) and later; if this property is specified on earlier versions of Android, it is ignored.

Default: false

  • 3.0
  • 3.0
  • 3.0

Briefly describes what performing an action (such as a click) on the view will do.

Briefly describes what performing an action (such as a click) on the view will do.

On iOS this is a direct analog of the accessibilityHint property defined in the UIAccessibility Protocol. On Android, it is concatenated together with accessibilityLabel and accessibilityValue in the order: accessibilityLabel, accessibilityValue, accessibilityHint. The concatenated value is then passed as the argument to the native View.setContentDescription method.

  • 3.0
  • 3.0
  • 3.0
A succint label identifying the view for the device's accessibility service. ...

A succint label identifying the view for the device's accessibility service.

On iOS this is a direct analog of the accessibilityLabel property defined in the UIAccessibility Protocol. On Android, it is concatenated together with accessibilityValue and accessibilityHint in the order: accessibilityLabel, accessibilityValue, accessibilityHint. The concatenated value is then passed as the argument to the native View.setContentDescription method.

Default: Title or label of the control.

  • 3.0
  • 3.0
  • 3.0
A string describing the value (if any) of the view for the device's accessibility service. ...

A string describing the value (if any) of the view for the device's accessibility service.

On iOS this is a direct analog of the accessibilityValue property defined in the UIAccessibility Protocol. On Android, it is concatenated together with accessibilityLabel and accessibilityHint in the order: accessibilityLabel, accessibilityValue, accessibilityHint. The concatenated value is then passed as the argument to the native View.setContentDescription method.

Default: State or value of the control.

  • 3.0
  • 3.0
  • 3.0
Coordinate of the view about which to pivot an animation. ...

Coordinate of the view about which to pivot an animation.

Used on iOS only. For Android, use Titanium.UI.Animation.anchorPoint.

Anchor point is specified as a fraction of the view's size. For example, {0, 0} is at the view's top-left corner, {0.5, 0.5} at its center and {1, 1} at its bottom-right corner.

See the "Using an anchorPoint" example in Titanium.UI.Animation for a demonstration.

Default: Center of this view.

  • 0.9
  • 0.9

Current position of the view during an animation.

Current position of the view during an animation.

  • 0.9
  • 0.9
apiName : Stringreadonly

The name of the API that this proxy corresponds to.

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.

  • 3.2
  • 3.2
  • 3.2
  • 3.2
  • 3.2
  • 3.2
Background color of the view, as a color name or hex triplet. ...

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

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

Default: Transparent

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

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.

Default: Same as the normal background color of this view.

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

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

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

  • 0.9
Focused background color of the view, as a color name or hex triplet. ...

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

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

For normal views, the focused color is only used if focusable is true.

Default: Same as the normal background color of this view.

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

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.

Default: If backgroundFocusedImage is undefined, and the normal background image backgroundImage is set, the normal image is used when this view is focused.

  • 0.9
A background gradient for the view. ...

A background gradient for the view.

A gradient can be defined as either linear or radial. A linear gradient varies continuously along a line between the startPoint and endPoint.

A radial gradient is interpolated between two circles, defined by startPoint and startRadius and endPoint and endRadius respectively.

The start and end points and radius values can be defined in device units, in the view's coordinates, or as percentages of the view's size. Thus, if a view is 60 x 60, the center point of the view can be specified as:

{ x: 30, y: 30 }

Or: { x: '50%', y: '50%' }

When specifying multiple colors, you can specify an offset value for each color, defining how far into the gradient it takes effect. For example, the following color array specifies a gradient that goes from red to blue back to red:

colors: [ { color: 'red', offset: 0.0}, { color: 'blue', offset: 0.25 }, { color: 'red', offset: 1.0 } ]

Mobile Web and Tizen have two limitations: backfillStart and backfillEnd are ignored and the system behaves as if they are true, and endPoint is not supported for radial gradients.

Android currently only supports linear gradients. It also ignores backfillStart and backfillEnd treating them as if they are true.

Example

Linear and Radial Gradients

The following code excerpt creates two views, one with a linear gradient and one with a radial gradient.

var win1 = Titanium.UI.createWindow({
    title:'Tab 1',
    backgroundColor:'#fff',
    layout: 'vertical'
});

var radialGradient = Ti.UI.createView({
    top: 10,
    width: 100,
    height: 100,
    backgroundGradient: {
        type: 'radial',
        startPoint: { x: 50, y: 50 },
        endPoint: { x: 50, y: 50 },
        colors: [ 'red', 'blue'],
        startRadius: '90%',
        endRadius: 0,
        backfillStart: true
    }
});
var linearGradient = Ti.UI.createView({
    top: 10,
    width: 100,
    height: 100,
    backgroundGradient: {
        type: 'linear',
        startPoint: { x: '0%', y: '50%' },
        endPoint: { x: '100%', y: '50%' },
        colors: [ { color: 'red', offset: 0.0}, { color: 'blue', offset: 0.25 }, { color: 'red', offset: 1.0 } ],
    }
});
win1.add(radialGradient);
win1.add(linearGradient);
win1.open();

Default: No gradient

  • 0.9
  • 0.9
  • 1.8
  • 3.1
  • 0.9
Background image for the view, specified as a local file path or URL. ...

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

Default: 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, text fields, and so on), platform-specific default images are used.

Size of the left end cap. ...

Size of the left end cap.

See the section on backgroundLeftCap and backgroundTopCap behavior on iOS in Titanium.UI.View.

Default: 0

  • 0.9
  • 0.9
Determines whether to tile a background across a view. ...

Determines whether to tile a background across a view.

Setting this to true makes the set backgroundImage repeat across the view as a series of tiles. The tiling begins in the upper-left corner, where the upper-left corner of the background image is rendered. The image is then tiled to fill the available space of the view.

Note that setting this to true may incur performance penalties for large views or background images, as the tiling must be redone whenever a view is resized.

On iOS, the following views do not currently support tiled backgrounds:

Default: false

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

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.

focusable must be true for normal views.

Default: Background color of this view.

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

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.

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

  • 0.9
  • 1.8
  • 3.1
Size of the top end cap. ...

Size of the top end cap.

See the section on backgroundLeftCap and backgroundTopCap behavior on iOS in Titanium.UI.View.

Default: 0

  • 0.9
  • 0.9
Border color of the view, as a color name or hex triplet. ...

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

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

Default: Same as the normal background color of this view (Android, Mobile Web, Tizen), black (iOS).

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1
Radius for the rounded corners of the view's border. ...

Radius for the rounded corners of the view's border.

Each corner is rounded using an arc of a circle.

Default: 0

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1
Border width of the view. ...

Border width of the view.

Default: 0

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1
: Number/String
View's bottom position, in platform-specific units. ...

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

This position is relative to the view's parent. Exact interpretation depends on the parent view's layout property. Can be either a float value or a dimension string (for example, '50%' or '10px').

This is an input property for specifying where the view should be positioned, and does not represent the view's calculated position.

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

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.

Default: true

  • 3.0
  • 3.0
  • 3.0
Titanium.UI.WebView
: Number
Determines how a cache is used in this web view. ...
View's center position, in the parent view's coordinates. ...

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

This is an input property for specifying where the view should be positioned, and does not represent the view's calculated position.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Array of this view's child views.

Array of this view's child views.

View's clipping behavior. ...

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.

Default: Undefined. Behaves as if set to Titanium.UI.iOS.CLIP_MODE_DEFAULT.

  • 3.3
  • 3.3

Web content to load.

Web content to load.

Android only supports loading data from a Blob, not a File.

For Mobile Web and Tizen, setting new content will reset the url and the WebView's history. The WebView's "onload" event will have already fired prior to the data being set inside the WebView.

See also: url and html.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1
Titanium.UI.WebView
: Boolean
Determines whether the view will bounce when scrolling to the edge of the scrollable region. ...

Determines whether the view will bounce when scrolling to the edge of the scrollable region.

Set to true to disable the bounce effect.

Default: false

  • 0.8
  • 0.8
Titanium.UI.WebView
: Boolean
If true, zoom controls are enabled. ...

If true, zoom controls are enabled.

Default: true

  • 1.8
Whether view should be focusable while navigating with the trackball. ...

Whether view should be focusable while navigating with the trackball.

Default: false

  • 0.9
Titanium.UI.WebView
: Boolean
Lets the webview handle platform supported urls ...

Lets the webview handle platform supported urls

By default any urls that are not handled by the Titanium platform but can be handled by the shared application are automatically sent to the shared application and the webview does not open these. When this property is set to true the webview will attempt to handle these urls and they will not be sent to the shared application. An example is links to telephone numbers.

Default: undefined. Behaves as if false

  • 3.3
  • 3.3
height : Number/String

View height, in platform-specific units.

View height, in platform-specific units.

Defaults to: If undefined, defaults to either Titanium.UI.FILL or Titanium.UI.SIZE depending on the view. See "View Types and Default Layout Behavior" in Transitioning to the New UI Layout System.

Can be either a float value or a dimension string (for example, '50%' or '40dp'). Can also be one of the following special values:

  • Titanium.UI.SIZE. The view should size itself to fit its contents.
  • Titanium.UI.FILL. The view should size itself to fill its parent.
  • 'auto'. Represents the default sizing behavior for a given type of view. The use of 'auto' is deprecated, and should be replaced with the SIZE or FILL constants if it is necessary to set the view's behavior explicitly.

    On Mobile Web and Tizen, 'auto' always selects SIZE behavior.

This is an input property for specifying the view's height dimension. To determine the view's size once rendered, use the rect or size properties.

This property can be assigned the following constants:

Titanium.UI.WebView
: Boolean
Hides activity indicator when loading remote URL. ...

Hides activity indicator when loading remote URL.

Default: false

  • 3.0
  • 3.0
Determines whether the layout has wrapping behavior. ...

Determines whether the layout has wrapping behavior.

For more information, see the discussion of horizontal layout mode in the description of the layout property.

Default: true

  • 2.1
  • 2.1
  • 2.1
  • 2.1
  • 3.1
Titanium.UI.WebView
html : String

HTML content of this web view.

HTML content of this web view.

See setHtml for additional parameters that can be specified when setting HTML content.

The web view's content can also be set using the data or url properties.

Mobile Web and Tizen Platform Notes

For Mobile Web and Tizen, setting new content will reset the url and the WebView's history.

Content added using the html property (or the setHtml method) will never receive an "onload" DOM event.

When querying this the html property, Mobile Web and Tizen return a modified version of the original html. The <html> tag is stripped off, along with any comments outside of the <html> tag. Some default attributes may be added as well. For example, a web page with the code:

<html><head></head><body>hello</body></html>

returns:

<head></head><body marginwidth="0" marginheight="0">hello</body>

in Safari.

See also: data and url.

Titanium.UI.WebView
: Boolean
Controls whether to ignore invalid SSL certificates or not. ...

Controls whether to ignore invalid SSL certificates or not.

If set to true, the web page loads despite having an invalid SSL certificate.

If set to false, a web page with an invalid SSL certificate does not load.

Default: undefined but behaves as false

  • 3.0
Determines whether to keep the device screen on. ...

Determines whether to keep the device screen on.

When true the screen will not power down. Note: enabling this feature will use more power, thereby adversely affecting run time when on battery.

Default: false

  • 0.9
Specifies how the view positions its children. ...

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

There are three layout options:

  • composite (or absolute). Default layout. A child view is positioned based on its positioning properties or "pins" (top, bottom, left, right and center). If no positioning properties are specified, the child is centered.

    The child is always sized based on its width and height properties, if these are specified. If the child's height or width is not specified explicitly, it may be calculated implicitly from the positioning properties. For example, if both left and center.x are specified, they can be used to calculate the width of the child control.

    Because the size and position properties can conflict, there is a specific precedence order for the layout properties. For vertical positioning, the precedence order is: height, top, center.y, bottom.

    The following table summarizes the various combinations of properties that can be used for vertical positioning, in order from highest precedence to lowest. (For example, if height, center.y and bottom are all specified, the height and center.y values take precedence.)

    ScenarioBehavior
    height & top specifiedChild positioned top unit from parent's top, using specified height; any center.y and bottom values are ignored.
    height & center.y specifiedChild positioned with center at center.y, using specified height; any bottom value is ignored.
    height & bottom specifiedChild positioned bottom units from parent's bottom, using specified height.
    top & center.y specifiedChild positioned with top edge top units from parent's top and center at center.y. Height is determined implicitly; any bottom value is ignored.
    top & bottom specifiedChild positioned with top edge top units from parent's top and bottom edge bottom units from parent's bottom. Height is determined implicitly.
    Only top specifiedChild positioned top units from parent's top, and uses the default height calculation for the view type.
    center.y and bottom specifiedChild positioned with center at center.y and bottom edge bottom units from parent's bottom. Height is determined implicitly.
    Only center.y specifiedChild positioned with center at center.y, and uses the default height calculation for the view type.
    Only bottom specifiedChild positioned with bottom edge bottom units from parent's bottom, and uses the default height calculation for the view type.
    height, top, center.y, and bottom unspecifiedChild centered vertically in the parent and uses the default height calculation for the child view type.

    Horizontal positioning works like vertical positioning, except that the precedence is width, left, center.x, right.

    For complete details on composite layout rules, see Transitioning to the New UI Layout System in the Titanium Mobile Guides.

  • vertical. Children are laid out vertically from top to bottom. The first child is laid out top units from its parent's bounding box. Each subsequent child is laid out below the previous child. The space between children is equal to the upper child's bottom value plus the lower child's top value.

    Each child is positioned horizontally as in the composite layout mode.

  • horizontal. Horizontal layouts have different behavior depending on whether wrapping is enabled. Wrapping is enabled by default (the horizontalWrap property is true).

    With wrapping behavior, the children are laid out horizontally from left to right, in rows. If a child requires more horizontal space than exists in the current row, it is wrapped to a new row. The height of each row is equal to the maximum height of the children in that row.

    Wrapping behavior is available on iOS, Android, Tizen and Mobile Web (Release 2.1.0 and later). When the horizontalWrap property is set to true, the first row is placed at the top of the parent view, and successive rows are placed below the first row. Each child is positioned vertically within its row somewhat like composite layout mode. In particular:

    • If neither top or bottom is specified, the child is centered in the row.
    • If either top or bottom is specified, the child is aligned to either the top or bottom of the row, with the specified amount of padding.
    • If both top and bottom is specified for a given child, the properties are both treated as padding.

    If the horizontalWrap property is false, the behavior is more equivalent to a vertical layout. Children are laid or horizontally from left to right in a single row. The left and right properties are used as padding between the children, and the top and bottom properties are used to position the children vertically.

    On Mobile Web prior to Release 2.1.0, the horizontal layout does not wrap by default, and does not support the horizontalWrap property. On Android and iOS prior to Release 2.1.0, the horizontal layout always wraps and the horizontalWrap property is not supported.

Default: Composite layout

: Number/String
View's left position, in platform-specific units. ...

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

This position is relative to the view's parent. Exact interpretation depends on the parent view's layout property. Can be either a float value or a dimension string (for example, '50%' or '10px').

This is an input property for specifying where the view should be positioned, and does not represent the view's calculated position.

Titanium.UI.WebView
: Boolean
Enables using light touches to make a selection and activate mouseovers. ...

Enables using light touches to make a selection and activate mouseovers.

Setting this property solves the problem of web links with specific length not triggering a link click in Android.

This is only an Android specific property and has no effect starting from API level 18.

This flag is true by default to retain backwards compatibility with previous behavior.

Default: true

  • 3.2
Titanium.UI.WebView
loading : Boolean

Indicates if the webview is loading content.

Indicates if the webview is loading content.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1
Titanium.UI.WebView
onCreateWindow : Callback<Object>

Callback function called when there is a request for the application to create a new window to host new content.

Callback function called when there is a request for the application to create a new window to host new content.

For example, the request is triggered if a web page wants to open a URL in a new window. By default, Titanium will open a new full-size window to host the new content. Use the callback to override the default behavior.

The callback needs to create a new WebView object to host the content in and add the WebView to the application UI. The callback must return either a WebView object to host the content in or null if it does not wish to handle the request.

The callback is passed a dictionary with two boolean properties:

  • isDialog: set to true if the content should be opened in a dialog window rather than a full-size window.
  • isUserGesture: set to true if the user initiated the request with a gesture, such as tapping a link.

The following example opens new web content in a new tab rather than a new window:

var tabGroup = Ti.UI.createTabGroup(),
    win = Ti.UI.createWindow(),
    tab = Ti.UI.createTab({window: win, title: 'Start Page'}),
    webview = Ti.UI.createWebView({ url:'index.html'});

webview.onCreateWindow = function(e) {
    var newWin = Ti.UI.createWindow(),
        newWebView = Ti.UI.createWebView(),
        newTab = Ti.UI.createTab({window: newWin, title: 'New Page'});
    newWin.add(newWebView);
    tabGroup.addTab(newTab);
    return newWebView;
};

win.add(webview);
tabGroup.addTab(tab);
tabGroup.open();

  • 2.1
Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). ...

Opacity of this view, from 0.0 (transparent) to 1.0 (opaque).

Default: 1.0 (opaque)

Titanium.UI.WebView
: Number
Determines the behavior when the user overscrolls the view. ...

Determines the behavior when the user overscrolls the view.

This property can be assigned the following constants:

Default: Titanium.UI.Android.OVER_SCROLL_ALWAYS

  • 3.1
When on, animate call overrides current animation if applicable. ...

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.

Default: undefined but behaves as false

  • 3.3
Titanium.UI.WebView
: Number
Determines how to treat content that requires plugins in this web view. ...

Determines how to treat content that requires plugins in this web view.

This setting affects the loading of content that requires web plugins, such as Flash Player.

To use the Flash Player plugin, hardware acceleration must be enabled for your application. To enable hardware acceleration, add the tool-api-level and manifest elements shown below inside the android element in your tiapp.xml file.

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <tool-api-level>11</tool-api-level>
    <manifest>
        <application android:hardwareAccelerated="true"/>
    </manifest>
</android>

See Android documentation for WebSettings.PluginState.

This property only works on Android devices at API Level 8 or greater.

This property can be assigned the following constants:

Default: Titanium.UI.Android.WEBVIEW_PLUGINS_OFF

  • 1.8
Background color of the wrapper view when this view is used as either Titanium.UI.ListView.pullView or Titanium.UI.Ta...

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

Default: Undefined. Results in a light grey background color on the wrapper view.

  • 3.3
  • 3.3

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

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

The view's bounding box is defined by its size and position.

The view's size is rect.width x rect.height. The view's top-left position relative to its parent is (rect.x , rect.y).

The correct values will only be available when layout is complete. To determine when layout is complete, add a listener for the postlayout event.

  • 2.0
  • 2.0
  • 2.0
  • 2.0
  • 3.1
: Number/String
View's right position, in platform-specific units. ...

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

This position is relative to the view's parent. Exact interpretation depends on the parent view's layout property. Can be either a float value or a dimension string (for example, '50%' or '10px').

This is an input property for specifying where the view should be positioned, and does not represent the view's calculated position.

Titanium.UI.WebView
: Boolean
If true, scale contents to fit the web view. ...

If true, scale contents to fit the web view.

On iOS, setting this to true sets the initial zoom level to show the entire page, and enables the user to zoom the web view in and out. Setting this to false prevents the user from zooming the web view.

On Android, only controls the initial zoom level.

Default: false on iOS. On Android, false when content is specified as a local URL, true for any other kind of content (remote URL, Blob, or File).

  • 0.8
  • 0.8
  • 0.8
Titanium.UI.WebView
: Boolean
Controls whether the scroll-to-top gesture is effective. ...

Controls whether the scroll-to-top gesture is effective.

The scroll-to-top gesture is a tap on the status bar; The default value of this property is true. This gesture works when you have a single visible web view. If there are multiple table views, web views, text areas, and/or scroll views visible, you will need to disable (set to false) on the above views you DON'T want this behaviour on. The remaining view will then respond to scroll-to-top gesture.

Default: true

  • 2.0
  • 2.0
Titanium.UI.WebView
: Boolean
If true, scrollbars are displayed if content is larger than the web view. ...

If true, scrollbars are displayed if content is larger than the web view.

Default: true

  • 1.8.2
  • 3.1

The size of the view in system units.

The size of the view in system units.

Although property returns a Dimension dictionary, only the width and height properties are valid. The position properties--x and y--are always 0.

To find the position and size of the view, use the rect property instead.

The correct values will only be available when layout is complete. To determine when layout is complete, add a listener for the postlayout event.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1
Determines keyboard behavior when this view is focused. ...
The view's tintColor. ...

The view's tintColor. This property is applicable on iOS 7 and greater.

This property is a direct correspondant of the tintColor property of UIView on iOS. If no value is specified, the tintColor of the View is inherited from its superview.

  • 3.1.3
  • 3.1.3
top : Number/String

The view's top position.

The view's top position.

This position is relative to the view's parent. Exact interpretation depends on the parent view's layout property. Can be either a float value or a dimension string (for example, '50%' or '10px').

This is an input property for specifying where the view should be positioned, and does not represent the view's calculated position.

Determines whether view should receive touch events. ...

Determines whether view should receive touch events.

If false, will forward the events to peers.

Default: true

Transformation matrix to apply to the view. ...

Transformation matrix to apply to the view.

Android, Tizen and Mobile Web only support 2DMatrix transforms.

Default: Identity matrix

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1
Titanium.UI.WebView
url : String

URL to the web document.

URL to the web document.

This property changes as the content of the webview changes (such as when the user clicks a hyperlink inside the web view).

See also: data and html.

On Tizen, the URL cannot refer to a File object. Ti.Filesystem uses web storage, which can't be accessed directly from a web view. The URL can be a string that points to a physical file on Tizen's file system (e.g. /opt/apps/kitchensink/index.html), or a remote location.

Titanium.UI.WebView
: String
The User-Agent header used by the web view when requesting content. ...

The User-Agent header used by the web view when requesting content.

Default: System default user-agent value.

  • 0.8
Determines the color of the shadow. ...

Determines the color of the shadow.

Default: Undefined. Behaves as if transparent.

  • 3.3
  • 3.3
Determines the offset for the shadow of the view. ...

Determines the offset for the shadow of the view.

Default: Undefined. Behaves as if set to (0,-3)

  • 3.3
  • 3.3
Determines the blur radius used to create the shadow. ...

Determines the blur radius used to create the shadow.

Default: Undefined. Behaves as if set to 3.

  • 3.3
  • 3.3
Determines whether the view is visible. ...

Determines whether the view is visible.

Default: true

width : Number/String

View's width, in platform-specific units.

View's width, in platform-specific units.

Defaults to: If undefined, defaults to either Titanium.UI.FILL or Titanium.UI.SIZE depending on the view. See "View Types and Default Layout Behavior" in Transitioning to the New UI Layout System.

Can be either a float value or a dimension string (for example, '50%' or '40dp'). Can also be one of the following special values:

  • Titanium.UI.SIZE. The view should size itself to fit its contents.
  • Titanium.UI.FILL. The view should size itself to fill its parent.
  • 'auto'. Represents the default sizing behavior for a given type of view. The use of 'auto' is deprecated, and should be replaced with the SIZE or FILL constants if it is necessary to set the view's behavior explicitly.

On Mobile Web and Tizen, 'auto' always selects SIZE behavior.

This is an input property for specifying the view's width dimension. To determine the view's size once rendered, use the rect or size properties.

This property can be assigned the following constants:

Titanium.UI.WebView
: Boolean
Explicitly specifies if this web view handles touches. ...

Explicitly specifies if this web view handles touches.

On the iOS platform, if this web view or any of its parent views have touch listeners, the Titanium component intercepts all touch events. This prevents the user from interacting with the native web view components.

Set this flag to false to disable the default behavior. Setting this property to false allows the user to interact with the native web view and still honor any touch events sent to its parents. No touch events will be generated when the user interacts with the web view itself.

Set this flag to true if you want to receive touch events from the web view and the user does not need to interact with the web content directly.

This flag is true by default to retain backwards compatibility with previous behavior.

Default: true

  • 1.8.2
  • 1.8.2
Z-index stack order position, relative to other sibling views. ...

Z-index stack order position, relative to other sibling views.

A view does not have a default z-index value, meaning that it is undefined by default. When this property is explicitly set, regardless of its value, it causes the view to be positioned in front of any sibling that has an undefined z-index.

Defined By

Methods

( name, callback ) : void
Adds the specified callback as an event listener for the named event. ...

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

Parameters

  • name : String

    Name of the event.

  • callback : Callback<Object>

    Callback function to invoke when the event is fired.

Returns

  • void
( animation, callback ) : void
Animates this view. ...

Animates this view.

The Animation object or dictionary passed to this method defines the end state for the animation, the duration of the animation, and other properties.

Note that if you use animate to move a view, the view's actual position is changed, but its layout properties, such as top, left, center and so on are not changed--these reflect the original values set by the user, not the actual position of the view.

The rect property can be used to determine the actual size and position of the view. Note that on Mobile Web and Tizen, the rect property is not updated after animation. This is a known issue TIMOB-8930.

Parameters

Returns

  • void
Applies the properties to the proxy. ...

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.

  • 3.0
  • 3.3
  • 3.0
  • 3.0
  • 3.0
  • 3.1

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Titanium.UI.WebView
( ) : Boolean
Returns true if the web view can go back in its history list. ...

Returns true if the web view can go back in its history list.

For Mobile Web and Tizen, returns true if url is set.

Returns

  • Boolean
Titanium.UI.WebView
( ) : Boolean
Returns true if the web view can go forward in its history list. ...

Returns true if the web view can go forward in its history list.

For Mobile Web and Tizen, returns true if url is set.

Returns

  • Boolean
( point, destinationView ) : Point
Translates a point from this view's coordinate system to another view's coordinate system. ...

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.

  • 1.8
  • 1.8
  • 1.8
  • 2.0
  • 3.1

Parameters

  • point : Point

    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.

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

Returns

Titanium.UI.WebView
( code ) : String
Evaluates a JavaScript expression inside the context of the web view and optionally, returns a result. ...

Evaluates a JavaScript expression inside the context of the web view and optionally, returns a result.

The JavaScript expression must be passed in as a string. If you are passing in any objects, you must serialize them to strings using stringify.

The evalJS method returns a string representing the value of the expression. For example, the following call retrieves the document.title element from the document currently loaded into the web view.

var docTitle = myWebView.evalJS('document.title');

It is not necessary to include return in the JavaScript. In fact, the following call returns the empty string:

myWebView.evalJS('return document.title');

For Mobile Web, you can only execute JavaScript when the contents are on the same domain.

Parameters

  • code : String

    JavaScript code as a string. The code will be evaluated inside the web view context.

Returns

  • String
( ) : voiddeprecated
Finishes a batch update of the View's layout properties and schedules a layout pass of the view tree. ...

Finishes a batch update of the View's layout properties and schedules a layout pass of the view tree.

deprecated since 3.0.0

Use the applyProperties method to batch-update layout properties.

Since the layout pass scheduled is asynchronous, the rect and size values may not be available immediately after finishLayout is called.

To be notified when the layout pass completes, add a listener for the postlayout event.

On Mobile Web and Tizen, this method has no effect, but is included for parity.

  • 2.0
  • 3.1.2
  • 2.0
  • 2.0
  • 2.0
  • 3.1

Returns

  • void
( name, event ) : void
Fires a synthesized event to any registered listeners. ...

Fires a synthesized event to any registered listeners.

Parameters

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

Returns

  • void
Gets the value of the accessibilityHidden property. ...

Gets the value of the accessibilityHidden property.

  • 3.0
  • 3.0
  • 3.0

Returns

  • Boolean
Gets the value of the accessibilityHint property. ...

Gets the value of the accessibilityHint property.

  • 3.0
  • 3.0
  • 3.0

Returns

  • String
Gets the value of the accessibilityLabel property. ...

Gets the value of the accessibilityLabel property.

  • 3.0
  • 3.0
  • 3.0

Returns

  • String
Gets the value of the accessibilityValue property. ...

Gets the value of the accessibilityValue property.

  • 3.0
  • 3.0
  • 3.0

Returns

  • String
Gets the value of the anchorPoint property. ...

Gets the value of the anchorPoint property.

  • 0.9
  • 0.9

Returns

Gets the value of the animatedCenter property. ...

Gets the value of the animatedCenter property.

  • 0.9
  • 0.9

Returns

Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2
  • 3.2
  • 3.2
  • 3.2
  • 3.2
  • 3.2

Returns

  • String
Gets the value of the backgroundColor property. ...

Gets the value of the backgroundColor property.

Returns

  • String
Gets the value of the backgroundDisabledColor property. ...

Gets the value of the backgroundDisabledColor property.

  • 0.9

Returns

  • String
Gets the value of the backgroundDisabledImage property. ...

Gets the value of the backgroundDisabledImage property.

  • 0.9

Returns

  • String
Gets the value of the backgroundFocusedColor property. ...

Gets the value of the backgroundFocusedColor property.

  • 0.9

Returns

  • String
Gets the value of the backgroundFocusedImage property. ...

Gets the value of the backgroundFocusedImage property.

  • 0.9

Returns

  • String
Gets the value of the backgroundGradient property. ...

Gets the value of the backgroundGradient property.

  • 0.9
  • 0.9
  • 1.8
  • 3.1
  • 0.9

Returns

Gets the value of the backgroundImage property. ...

Gets the value of the backgroundImage property.

Returns

  • String
Gets the value of the backgroundLeftCap property. ...

Gets the value of the backgroundLeftCap property.

  • 0.9
  • 0.9

Returns

  • Number
Gets the value of the backgroundRepeat property. ...

Gets the value of the backgroundRepeat property.

  • 0.9
  • 0.9
  • 0.9

Returns

  • Boolean
Gets the value of the backgroundSelectedColor property. ...

Gets the value of the backgroundSelectedColor property.

  • 0.9
  • 1.8
  • 3.1

Returns

  • String
Gets the value of the backgroundSelectedImage property. ...

Gets the value of the backgroundSelectedImage property.

  • 0.9
  • 1.8
  • 3.1

Returns

  • String
Gets the value of the backgroundTopCap property. ...

Gets the value of the backgroundTopCap property.

  • 0.9
  • 0.9

Returns

  • Number
Gets the value of the borderColor property. ...

Gets the value of the borderColor property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Returns

  • String
Gets the value of the borderRadius property. ...

Gets the value of the borderRadius property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Returns

  • Number
Gets the value of the borderWidth property. ...

Gets the value of the borderWidth property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Returns

  • Number
( ) : Number/String
Gets the value of the bottom property. ...

Gets the value of the bottom property.

Returns

  • Number/String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0
  • 3.0
  • 3.0

Returns

  • Boolean
Titanium.UI.WebView
( ) : Number
Gets the value of the cacheMode property. ...

Gets the value of the cacheMode property.

  • 3.2

Returns

  • Number
Gets the value of the center property. ...

Gets the value of the center property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Returns

Gets the value of the children property. ...

Gets the value of the children property.

Returns

Gets the value of the clipMode property. ...

Gets the value of the clipMode property.

  • 3.3
  • 3.3

Returns

  • Number
Gets the value of the data property. ...

Gets the value of the data property.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1

Returns

Titanium.UI.WebView
( ) : Boolean
Gets the value of the disableBounce property. ...

Gets the value of the disableBounce property.

  • 0.8
  • 0.8

Returns

  • Boolean
Titanium.UI.WebView
( ) : Boolean
Gets the value of the enableZoomControls property. ...

Gets the value of the enableZoomControls property.

  • 1.8

Returns

  • Boolean
Gets the value of the focusable property. ...

Gets the value of the focusable property.

  • 0.9

Returns

  • Boolean
Titanium.UI.WebView
( ) : Boolean
Gets the value of the handlePlatformUrl property. ...

Gets the value of the handlePlatformUrl property.

  • 3.3
  • 3.3

Returns

  • Boolean
( ) : Number/String
Gets the value of the height property. ...

Gets the value of the height property.

Returns

  • Number/String
Titanium.UI.WebView
( ) : Boolean
Gets the value of the hideLoadIndicator property. ...

Gets the value of the hideLoadIndicator property.

  • 3.0
  • 3.0

Returns

  • Boolean
Gets the value of the horizontalWrap property. ...

Gets the value of the horizontalWrap property.

  • 2.1
  • 2.1
  • 2.1
  • 2.1
  • 3.1

Returns

  • Boolean
Titanium.UI.WebView
( ) : String
Gets the value of the html property. ...

Gets the value of the html property.

Returns

  • String
Titanium.UI.WebView
( ) : Boolean
Gets the value of the ignoreSslError property. ...

Gets the value of the ignoreSslError property.

  • 3.0

Returns

  • Boolean
Gets the value of the keepScreenOn property. ...

Gets the value of the keepScreenOn property.

  • 0.9

Returns

  • Boolean
Gets the value of the layout property. ...

Gets the value of the layout property.

Returns

  • String
( ) : Number/String
Gets the value of the left property. ...

Gets the value of the left property.

Returns

  • Number/String
Titanium.UI.WebView
( ) : Boolean
Gets the value of the lightTouchEnabled property. ...

Gets the value of the lightTouchEnabled property.

  • 3.2

Returns

  • Boolean
Titanium.UI.WebView
( ) : Boolean
Gets the value of the loading property. ...

Gets the value of the loading property.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1

Returns

  • Boolean
Titanium.UI.WebView
( ) : Callback<Object>
Gets the value of the onCreateWindow property. ...

Gets the value of the onCreateWindow property.

  • 2.1

Returns

  • Callback<Object>
Gets the value of the opacity property. ...

Gets the value of the opacity property.

Returns

  • Number
Titanium.UI.WebView
( ) : Number
Gets the value of the overScrollMode property. ...

Gets the value of the overScrollMode property.

  • 3.1

Returns

  • Number
Gets the value of the overrideCurrentAnimation property. ...

Gets the value of the overrideCurrentAnimation property.

  • 3.3

Returns

  • Boolean
Titanium.UI.WebView
( ) : Number
Gets the value of the pluginState property. ...

Gets the value of the pluginState property.

  • 1.8

Returns

  • Number
Gets the value of the pullBackgroundColor property. ...

Gets the value of the pullBackgroundColor property.

  • 3.3
  • 3.3

Returns

  • String
Gets the value of the rect property. ...

Gets the value of the rect property.

  • 2.0
  • 2.0
  • 2.0
  • 2.0
  • 3.1

Returns

( ) : Number/String
Gets the value of the right property. ...

Gets the value of the right property.

Returns

  • Number/String
Titanium.UI.WebView
( ) : Boolean
Gets the value of the scalesPageToFit property. ...

Gets the value of the scalesPageToFit property.

  • 0.8
  • 0.8
  • 0.8

Returns

  • Boolean
Titanium.UI.WebView
( ) : Boolean
Gets the value of the scrollsToTop property. ...

Gets the value of the scrollsToTop property.

  • 2.0
  • 2.0

Returns

  • Boolean
Titanium.UI.WebView
( ) : Boolean
Gets the value of the showScrollbars property. ...

Gets the value of the showScrollbars property.

  • 1.8.2
  • 3.1

Returns

  • Boolean
Gets the value of the size property. ...

Gets the value of the size property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Returns

Gets the value of the softKeyboardOnFocus property. ...

Gets the value of the softKeyboardOnFocus property.

  • 0.9

Returns

  • Number
Gets the value of the tintColor property. ...

Gets the value of the tintColor property.

  • 3.1.3
  • 3.1.3

Returns

  • String
( ) : Number/String
Gets the value of the top property. ...

Gets the value of the top property.

Returns

  • Number/String
Gets the value of the touchEnabled property. ...

Gets the value of the touchEnabled property.

Returns

  • Boolean
Gets the value of the transform property. ...

Gets the value of the transform property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Returns

Titanium.UI.WebView
( ) : String
Gets the value of the url property. ...

Gets the value of the url property.

Returns

  • String
Titanium.UI.WebView
( ) : String
Gets the value of the userAgent property. ...

Gets the value of the userAgent property.

  • 0.8

Returns

  • String
Gets the value of the viewShadowColor property. ...

Gets the value of the viewShadowColor property.

  • 3.3
  • 3.3

Returns

  • String
Gets the value of the viewShadowOffset property. ...

Gets the value of the viewShadowOffset property.

  • 3.3
  • 3.3

Returns

Gets the value of the viewShadowRadius property. ...

Gets the value of the viewShadowRadius property.

  • 3.3
  • 3.3

Returns

  • Number
Gets the value of the visible property. ...

Gets the value of the visible property.

Returns

  • Boolean
( ) : Number/String
Gets the value of the width property. ...

Gets the value of the width property.

Returns

  • Number/String
Titanium.UI.WebView
( ) : Boolean
Gets the value of the willHandleTouches property. ...

Gets the value of the willHandleTouches property.

  • 1.8.2
  • 1.8.2

Returns

  • Boolean
Gets the value of the zIndex property. ...

Gets the value of the zIndex property.

Returns

  • Number
Titanium.UI.WebView
( ) : void
Goes back one entry in the web view's history list, to the previous page. ...

Goes back one entry in the web view's history list, to the previous page.

For Mobile Web, you can only go back for same domain pages. If you set the initial url to a remote page, the back function will not work. If you load a local page, then the user navigates away to a remote page, you cannot go back.

Returns

  • void
Titanium.UI.WebView
( ) : void
Goes forward one entry in this web view's history list, if possible. ...

Goes forward one entry in this web view's history list, if possible.

For Mobile Web, you can only go forward for same domain pages. If you set the initial url to a remote page, the forward function will not work.

Returns

  • void
Hides this view. ...

Hides this view.

Returns

  • void
Titanium.UI.WebView
( ) : void
Pauses native webview plugins. ...

Pauses native webview plugins.

Add a pause handler to your Titanium.Android.Activity and invoke this method to pause native plugins. This is important with Flash content as it will continue in the background unless this method is invoked.

Call resume to unpause native plugins.

  • 1.8

Returns

  • void
Titanium.UI.WebView
( ) : void
Releases memory when the web view is no longer needed. ...

Releases memory when the web view is no longer needed.

  • 2.0

Returns

  • void
Titanium.UI.WebView
( ) : void
Reloads the current webpage. ...

Reloads the current webpage.

For Mobile Web and Tizen, when you reload, the last visited same domain page or the original url is the page that is reloaded and all local URL history is reset. The history of remote URLs is preserved.

You may need to simply reset the url property to reinitialize the WebView's iframe.

Returns

  • void
( view ) : void
Removes a child view from this view's hierarchy. ...

Removes a child view from this view's hierarchy.

Parameters

Returns

  • void
( name, callback ) : void
Removes the specified callback as an event listener for the named event. ...

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

  • name : String

    Name of the event.

  • callback : Callback<Object>

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

Returns

  • void
Titanium.UI.WebView
( ) : void
Forces the web view to repaint its contents. ...

Forces the web view to repaint its contents.

  • 0.8
  • 0.8

Returns

  • void
Titanium.UI.WebView
( ) : void
Resume native webview plugins. ...

Resume native webview plugins.

Used to unpause native plugins after calling pause.

Add a resume handler to your Titanium.Android.Activity and invoke this method to resume native plugins.

  • 1.8

Returns

  • void
( accessibilityHidden ) : void
Sets the value of the accessibilityHidden property. ...

Sets the value of the accessibilityHidden property.

  • 3.0
  • 3.0
  • 3.0

Parameters

  • accessibilityHidden : Boolean

    New value for the property.

Returns

  • void
( accessibilityHint ) : void
Sets the value of the accessibilityHint property. ...

Sets the value of the accessibilityHint property.

  • 3.0
  • 3.0
  • 3.0

Parameters

  • accessibilityHint : String

    New value for the property.

Returns

  • void
( accessibilityLabel ) : void
Sets the value of the accessibilityLabel property. ...

Sets the value of the accessibilityLabel property.

  • 3.0
  • 3.0
  • 3.0

Parameters

  • accessibilityLabel : String

    New value for the property.

Returns

  • void
( accessibilityValue ) : void
Sets the value of the accessibilityValue property. ...

Sets the value of the accessibilityValue property.

  • 3.0
  • 3.0
  • 3.0

Parameters

  • accessibilityValue : String

    New value for the property.

Returns

  • void
( anchorPoint ) : void
Sets the value of the anchorPoint property. ...

Sets the value of the anchorPoint property.

  • 0.9
  • 0.9

Parameters

  • anchorPoint : Point

    New value for the property.

Returns

  • void
( backgroundColor ) : void
Sets the value of the backgroundColor property. ...

Sets the value of the backgroundColor property.

Parameters

  • backgroundColor : String

    New value for the property.

Returns

  • void
( backgroundDisabledColor ) : void
Sets the value of the backgroundDisabledColor property. ...

Sets the value of the backgroundDisabledColor property.

  • 0.9

Parameters

  • backgroundDisabledColor : String

    New value for the property.

Returns

  • void
( backgroundDisabledImage ) : void
Sets the value of the backgroundDisabledImage property. ...

Sets the value of the backgroundDisabledImage property.

  • 0.9

Parameters

  • backgroundDisabledImage : String

    New value for the property.

Returns

  • void
( backgroundFocusedColor ) : void
Sets the value of the backgroundFocusedColor property. ...

Sets the value of the backgroundFocusedColor property.

  • 0.9

Parameters

  • backgroundFocusedColor : String

    New value for the property.

Returns

  • void
( backgroundFocusedImage ) : void
Sets the value of the backgroundFocusedImage property. ...

Sets the value of the backgroundFocusedImage property.

  • 0.9

Parameters

  • backgroundFocusedImage : String

    New value for the property.

Returns

  • void
( backgroundGradient ) : void
Sets the value of the backgroundGradient property. ...

Sets the value of the backgroundGradient property.

  • 0.9
  • 0.9
  • 1.8
  • 3.1
  • 0.9

Parameters

  • backgroundGradient : Gradient

    New value for the property.

Returns

  • void
( backgroundImage ) : void
Sets the value of the backgroundImage property. ...

Sets the value of the backgroundImage property.

Parameters

  • backgroundImage : String

    New value for the property.

Returns

  • void
( backgroundLeftCap ) : void
Sets the value of the backgroundLeftCap property. ...

Sets the value of the backgroundLeftCap property.

  • 0.9
  • 0.9

Parameters

  • backgroundLeftCap : Number

    New value for the property.

Returns

  • void
( backgroundRepeat ) : void
Sets the value of the backgroundRepeat property. ...

Sets the value of the backgroundRepeat property.

  • 0.9
  • 0.9
  • 0.9

Parameters

  • backgroundRepeat : Boolean

    New value for the property.

Returns

  • void
( backgroundSelectedColor ) : void
Sets the value of the backgroundSelectedColor property. ...

Sets the value of the backgroundSelectedColor property.

  • 0.9
  • 1.8
  • 3.1

Parameters

  • backgroundSelectedColor : String

    New value for the property.

Returns

  • void
( backgroundSelectedImage ) : void
Sets the value of the backgroundSelectedImage property. ...

Sets the value of the backgroundSelectedImage property.

  • 0.9
  • 1.8
  • 3.1

Parameters

  • backgroundSelectedImage : String

    New value for the property.

Returns

  • void
( backgroundTopCap ) : void
Sets the value of the backgroundTopCap property. ...

Sets the value of the backgroundTopCap property.

  • 0.9
  • 0.9

Parameters

  • backgroundTopCap : Number

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( username, password ) : void
Sets the basic authentication for this web view to use on subsequent URl requests. ...

Sets the basic authentication for this web view to use on subsequent URl requests.

  • 0.8
  • 0.8
  • 0.8
  • 3.1

Parameters

  • username : String

    Basic auth username.

  • password : String

    Basic auth password.

Returns

  • void
( borderColor ) : void
Sets the value of the borderColor property. ...

Sets the value of the borderColor property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Parameters

  • borderColor : String

    New value for the property.

Returns

  • void
( borderRadius ) : void
Sets the value of the borderRadius property. ...

Sets the value of the borderRadius property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Parameters

  • borderRadius : Number

    New value for the property.

Returns

  • void
( borderWidth ) : void
Sets the value of the borderWidth property. ...

Sets the value of the borderWidth property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Parameters

  • borderWidth : Number

    New value for the property.

Returns

  • void
( bottom ) : void
Sets the value of the bottom property. ...

Sets the value of the bottom property.

Parameters

  • bottom : Number/String

    New value for the property.

Returns

  • void
( bubbleParent ) : void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0
  • 3.0
  • 3.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( cacheMode ) : void
Sets the value of the cacheMode property. ...

Sets the value of the cacheMode property.

  • 3.2

Parameters

  • cacheMode : Number

    New value for the property.

Returns

  • void
( center ) : void
Sets the value of the center property. ...

Sets the value of the center property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Parameters

  • center : Point

    New value for the property.

Returns

  • void
( clipMode ) : void
Sets the value of the clipMode property. ...

Sets the value of the clipMode property.

  • 3.3
  • 3.3

Parameters

  • clipMode : Number

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( data ) : void
Sets the value of the data property. ...

Sets the value of the data property.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1

Parameters

Returns

  • void
Titanium.UI.WebView
( disableBounce ) : void
Sets the value of the disableBounce property. ...

Sets the value of the disableBounce property.

  • 0.8
  • 0.8

Parameters

  • disableBounce : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( enableZoomControls ) : void
Sets the value of the enableZoomControls property. ...

Sets the value of the enableZoomControls property.

  • 1.8

Parameters

  • enableZoomControls : Boolean

    New value for the property.

Returns

  • void
( focusable ) : void
Sets the value of the focusable property. ...

Sets the value of the focusable property.

  • 0.9

Parameters

  • focusable : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( handlePlatformUrl ) : void
Sets the value of the handlePlatformUrl property. ...

Sets the value of the handlePlatformUrl property.

  • 3.3
  • 3.3

Parameters

  • handlePlatformUrl : Boolean

    New value for the property.

Returns

  • void
( height ) : void
Sets the value of the height property. ...

Sets the value of the height property.

Parameters

  • height : Number/String

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( hideLoadIndicator ) : void
Sets the value of the hideLoadIndicator property. ...

Sets the value of the hideLoadIndicator property.

  • 3.0
  • 3.0

Parameters

  • hideLoadIndicator : Boolean

    New value for the property.

Returns

  • void
( horizontalWrap ) : void
Sets the value of the horizontalWrap property. ...

Sets the value of the horizontalWrap property.

  • 2.1
  • 2.1
  • 2.1
  • 2.1
  • 3.1

Parameters

  • horizontalWrap : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( html, [options] ) : void
Sets the value of html property. ...

Sets the value of html property.

The options parameter can be used to specify two options that affect the WebView main content presentation:

  • baseURL. Sets the base URL for the content.
  • mimeType. Sets the MIME type for the content. Defaults to "text/html" if not specified.

For example:

setHtml('<html><body>Hello, <a href="/documentation">Titanium</a>!</body></html>',
        {baseURL:'http://developer.appcelerator.com/'});

Parameters

  • html : Object

    New HTML to display in the web view.

  • options : Dictionary (optional)

    Optional parameters for the content. Only used by iOS and Android.

Returns

  • void
Titanium.UI.WebView
( ignoreSslError ) : void
Sets the value of the ignoreSslError property. ...

Sets the value of the ignoreSslError property.

  • 3.0

Parameters

  • ignoreSslError : Boolean

    New value for the property.

Returns

  • void
( keepScreenOn ) : void
Sets the value of the keepScreenOn property. ...

Sets the value of the keepScreenOn property.

  • 0.9

Parameters

  • keepScreenOn : Boolean

    New value for the property.

Returns

  • void
( layout ) : void
Sets the value of the layout property. ...

Sets the value of the layout property.

Parameters

  • layout : String

    New value for the property.

Returns

  • void
Sets the value of the left property. ...

Sets the value of the left property.

Parameters

  • left : Number/String

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( lightTouchEnabled ) : void
Sets the value of the lightTouchEnabled property. ...

Sets the value of the lightTouchEnabled property.

  • 3.2

Parameters

  • lightTouchEnabled : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( loading ) : void
Sets the value of the loading property. ...

Sets the value of the loading property.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1

Parameters

  • loading : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( onCreateWindow ) : void
Sets the value of the onCreateWindow property. ...

Sets the value of the onCreateWindow property.

  • 2.1

Parameters

  • onCreateWindow : Callback<Object>

    New value for the property.

Returns

  • void
( opacity ) : void
Sets the value of the opacity property. ...

Sets the value of the opacity property.

Parameters

  • opacity : Number

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( overScrollMode ) : void
Sets the value of the overScrollMode property. ...

Sets the value of the overScrollMode property.

  • 3.1

Parameters

  • overScrollMode : Number

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( pluginState ) : void
Sets the value of the pluginState property. ...

Sets the value of the pluginState property.

  • 1.8

Parameters

  • pluginState : Number

    New value for the property.

Returns

  • void
( pullBackgroundColor ) : void
Sets the value of the pullBackgroundColor property. ...

Sets the value of the pullBackgroundColor property.

  • 3.3
  • 3.3

Parameters

  • pullBackgroundColor : String

    New value for the property.

Returns

  • void
( right ) : void
Sets the value of the right property. ...

Sets the value of the right property.

Parameters

  • right : Number/String

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( scalesPageToFit ) : void
Sets the value of the scalesPageToFit property. ...

Sets the value of the scalesPageToFit property.

  • 0.8
  • 0.8
  • 0.8

Parameters

  • scalesPageToFit : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( scrollsToTop ) : void
Sets the value of the scrollsToTop property. ...

Sets the value of the scrollsToTop property.

  • 2.0
  • 2.0

Parameters

  • scrollsToTop : Boolean

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( showScrollbars ) : void
Sets the value of the showScrollbars property. ...

Sets the value of the showScrollbars property.

  • 1.8.2
  • 3.1

Parameters

  • showScrollbars : Boolean

    New value for the property.

Returns

  • void
( softKeyboardOnFocus ) : void
Sets the value of the softKeyboardOnFocus property. ...

Sets the value of the softKeyboardOnFocus property.

  • 0.9

Parameters

  • softKeyboardOnFocus : Number

    New value for the property.

Returns

  • void
( tintColor ) : void
Sets the value of the tintColor property. ...

Sets the value of the tintColor property.

  • 3.1.3
  • 3.1.3

Parameters

  • tintColor : String

    New value for the property.

Returns

  • void
Sets the value of the top property. ...

Sets the value of the top property.

Parameters

  • top : Number/String

    New value for the property.

Returns

  • void
( touchEnabled ) : void
Sets the value of the touchEnabled property. ...

Sets the value of the touchEnabled property.

Parameters

  • touchEnabled : Boolean

    New value for the property.

Returns

  • void
( transform ) : void
Sets the value of the transform property. ...

Sets the value of the transform property.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Parameters

Returns

  • void
Titanium.UI.WebView
( url ) : void
Sets the value of the url property. ...

Sets the value of the url property.

Parameters

  • url : String

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( userAgent ) : void
Sets the value of the userAgent property. ...

Sets the value of the userAgent property.

  • 0.8

Parameters

  • userAgent : String

    New value for the property.

Returns

  • void
( viewShadowColor ) : void
Sets the value of the viewShadowColor property. ...

Sets the value of the viewShadowColor property.

  • 3.3
  • 3.3

Parameters

  • viewShadowColor : String

    New value for the property.

Returns

  • void
( viewShadowOffset ) : void
Sets the value of the viewShadowOffset property. ...

Sets the value of the viewShadowOffset property.

  • 3.3
  • 3.3

Parameters

  • viewShadowOffset : Point

    New value for the property.

Returns

  • void
( viewShadowRadius ) : void
Sets the value of the viewShadowRadius property. ...

Sets the value of the viewShadowRadius property.

  • 3.3
  • 3.3

Parameters

  • viewShadowRadius : Number

    New value for the property.

Returns

  • void
( visible ) : void
Sets the value of the visible property. ...

Sets the value of the visible property.

Parameters

  • visible : Boolean

    New value for the property.

Returns

  • void
( width ) : void
Sets the value of the width property. ...

Sets the value of the width property.

Parameters

  • width : Number/String

    New value for the property.

Returns

  • void
Titanium.UI.WebView
( willHandleTouches ) : void
Sets the value of the willHandleTouches property. ...

Sets the value of the willHandleTouches property.

  • 1.8.2
  • 1.8.2

Parameters

  • willHandleTouches : Boolean

    New value for the property.

Returns

  • void
( zIndex ) : void
Sets the value of the zIndex property. ...

Sets the value of the zIndex property.

Parameters

  • zIndex : Number

    New value for the property.

Returns

  • void
Makes this view visible. ...

Makes this view visible.

Returns

  • void
( ) : voiddeprecated
Starts a batch update of this view's layout properties. ...

Starts a batch update of this view's layout properties.

deprecated since 3.0.0

Use the applyProperties method to batch-update layout properties.

To prevent a layout pass each time a property is modified, call startLayout before changing any properties that may change this view's layout. This initiates a batch update mode where layout changes are deferred.

Call finishLayout to end batch update mode and trigger a layout pass. For example:

view.startLayout();
view.top = 50;
view.left = 50;
view.finishLayout();

Note that any property changes made during the batch update may be deferred until finishLayout is called. This may vary somewhat by platform. For example, changing the text of a label may trigger a layout pass. In iOS, updating the label text is deferred, while on Mobile Web and Tizen, the label text is updated immediately but the control is not resized until finishLayout is called.

See also: updateLayout, finishLayout, postlayout event.

On Mobile Web and Tizen, this method is included for parity only, and thus has no effect.

  • 2.0
  • 3.1.2
  • 2.0
  • 2.0
  • 2.0
  • 3.1

Returns

  • void
Titanium.UI.WebView
( hardStop ) : void
Stops loading a currently loading page. ...

Stops loading a currently loading page.

For Mobile Web, due to browser permissions, this will issue a stop on all windows including the parent and all other web views. Generally, this feature does not work reliably and instead you may choose to set the hardStop argument to true.

When hardStop is set to true, the Mobile Web and Tizen platforms will destroy the iFrame used to display the content, so nothing is displayed where the web view used to be. The actual web view component is not destroyed, and you can redisplay it by calling reload, or by specifying new content.

  • 0.8
  • 0.8
  • 0.8
  • 1.8
  • 3.1

Parameters

  • hardStop : Boolean

    Forces the web view to destroy the iFrame (Mobile Web and Tizen only).

Returns

  • void
( [callback], [honorScaleFactor] ) : Titanium.Blob
Returns an image of the rendered view, as a Blob. ...

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

The honorScaleFactor method is only supported on iOS.

  • 0.9
  • 0.9
  • 0.9

Parameters

  • callback : Callback<Titanium.Blob> (optional)

    Function to be invoked upon completion. If non-null, this method will be performed asynchronously. If null, it will be performed immediately. On Tizen, this function is asynchronous only. The callback is mandatory and function always returns "undefined".

  • honorScaleFactor : Boolean (optional)

    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.

    Default: False

Returns

( params ) : voiddeprecated
Performs a batch update of all supplied layout properties and schedules a layout pass after they have been updated. ...

Performs a batch update of all supplied layout properties and schedules a layout pass after they have been updated.

deprecated since 3.0.0

Use the applyProperties method to batch-update layout properties.

This is another way to perform a batch update. The updateLayout method is called with a dictionary of layout properties to perform the batch update. For example:

view.updateLayout({top:50, left:50});

This is equivalent to the following:

view.startLayout();
view.top = 50;
view.left = 50;
view.finishLayout();

See also: startLayout, finishLayout, postlayout event.

On Mobile Web and Tizen, this method is included for parity only, and thus has no effect.

  • 2.0
  • 3.1.2
  • 2.0
  • 2.0
  • 2.0
  • 3.1

Parameters

  • params : Dictionary

    Layout properties to be updated.

Returns

  • void
Defined By

Events

Titanium.UI.WebView
Fired before the web view starts loading its content. ...

Fired before the web view starts loading its content.

This event may fire multiple times depending on the content or URL. For example, if you set the URL of the web view to a URL that redirects to another URL, such as an HTTP URL redirecting to an HTTPS URL, this event is fired for the original URL and the redirect URL.

For Mobile Web and Tizen, if you pass the url into the constructor, you must attach the event listener before adding the web view to its parent, otherwise the event will fire before you have a chance to add the event listener.

This event does not fire when navigating remote web pages.

Properties

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

Fired when the device detects a click against the view.

There is a subtle difference between singletap and click events.

A singletap event is generated when the user taps the screen briefly without moving their finger. This gesture will also generate a click event.

However, a click event can also be generated when the user touches, moves their finger, and then removes it from the screen.

On Android, a click event can also be generated by a trackball click.

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

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

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

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

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

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

  • 0.9
  • 0.9
  • 0.9

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

Titanium.UI.WebView
Fired when the web view cannot load the content. ...

Fired when the web view cannot load the content.

For Mobile Web, generally this event will not fire, even for 404, 500, and invalid URLs. The errorCode value refers to one of the Titanium.UI URL_ERROR constants or, if it does not match one of those constants, it refers to a platform-specific constant. The platform-specific values are underlying iOS NSURLError* or Android WebViewClient ERROR_* constants.

Properties

Fired when the view element gains focus. ...

Fired when the view element gains focus.

This event only fires when using the trackball to navigate.

  • 0.9

Properties

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

Fired when a hardware key is pressed in the view. ...

Fired when a hardware key is pressed in the view.

A keypressed event is generated by pressing a hardware key. On Android, this event can only be fired when the property focusable is set to true.

  • 3.1

Properties

  • bubbles : Boolean

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

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
  • keyCode : Number

    The code for the physical key that was pressed. For more details, see KeyEvent. This API is experimental and subject to change.

  • source : Object

    Source object that fired the event.

  • type : String

    Name of the event fired.

Titanium.UI.WebView
Fired when the web view content is loaded. ...

Fired when the web view content is loaded.

For Mobile Web and Tizen, the url returned in the load event is generally accurate when loading same domain pages and remote pages that you explicitly set using the url property. If you navigate to a remote page, then this url is set to the initial remote page's URL.

Properties

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

  • url : Object

    URL of the web document.

Fired when the device detects a long click. ...

Fired when the device detects a long click.

A long click is generated by touching and holding on the touchscreen or holding down the trackball button.

The event occurs before the finger/button is lifted.

A longpress and a longclick can occur together.

As the trackball can fire this event, it is not intended to return the x and y coordinates of the touch, even when it is generated by the touchscreen.

A longclick blocks a click, meaning that a click event will not fire when a longclick listener exists.

  • 0.9

Properties

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

Fired when the device detects a long press. ...

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.

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

Fired when the device detects a pinch gesture. ...

Fired when the device detects a pinch gesture.

A pinch is a touch and expand or contract with two fingers. The event occurs continuously until a finger is lifted again.

  • 1.8
  • 1.8

Properties

  • bubbles : Boolean

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

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
  • scale : Number

    The scale factor relative to the points of the two touches in screen coordinates.

  • source : Object

    Source object that fired the event.

  • type : String

    Name of the event fired.

  • velocity : Number

    The velocity of the pinch in scale factor per second.

Fired when a layout cycle is finished. ...

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. On Mobile Web, this event can also be triggered by resizing the browser window.

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

  • 2.0
  • 3.1.2
  • 2.0
  • 2.0
  • 2.0
  • 3.1

Properties

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

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

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

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

Titanium.UI.WebView
Fired when an SSL error occurred. ...

Fired when an SSL error occurred.

Android only. This is a synchronous event and the developer can change the value of ignoreSslError to control if the request should proceed or fail.

  • 3.3

Properties

  • bubbles : Boolean

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

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
  • code : Number

    SSL error code.

  • source : Object

    Source object that fired the event.

  • type : String

    Name of the event fired.

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

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

  • 0.9
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Properties

  • bubbles : Boolean

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

    •  
    •  
    •  
  • cancelBubble : Boolean

    Set to true to stop the event from bubbling.

    •  
    •  
    •  
  • direction : String

    Direction of the swipe--either 'left', 'right', 'up', or 'down'.

  • source : Object

    Source object that fired the event.

  • type : String

    Name of the event fired.

  • x : Number

    X coordinate of the event's endpoint from the source view's coordinate system.

  • y : Number

    Y coordinate of the event's endpoint from the source view's coordinate system.

Fired when a touch event is interrupted by the device. ...

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.

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

Fired when a touch event is completed. ...

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.

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

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

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

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

Fired as soon as the device detects a touch gesture. ...

Fired as soon as the device detects a touch gesture.

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.

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

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

  • 3.0
  • 0.9
  • 0.9
  • 1.8
  • 3.1

Properties

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

  • x : Number

    X coordinate of the event from the source view's coordinate system.

  • y : Number

    Y coordinate of the event from the source view's coordinate system.