Titanium.UI.ActivityIndicator

Object of Titanium.UI.
Platform Since
Android 0.8
iPhone 0.8
iPad 0.8
Mobile Web 0.8

Summary

An activity indicator that lets the user know an action is taking place.

Description

An activity indicator can be used to show the progress of an operation in the UI to let the user know some action is taking place. An activity indicator consists of a spinning animation and an optional text message, and is used to indicate an ongoing activity of indeterminate length. To show progress, use Titanium.UI.ProgressBar instead.

Use the Titanium.UI.createActivityIndicator method to create an Activity Indicator.

Activity indicators must be used differently on Android and iOS:

  • On Android, the activity indicator is a modal dialog that blocks the UI. Calling show displays the indicator, and calling hide removes it.

  • On iOS, the activity indicator is a view like any other view, and must be added to a window or other top-level view before it can be shown. Note that unlike most views, the activity indicator is hidden by default and must be shown explicitly.

Code Examples

Simple Activity Indicator (Android)

In this example, we create a basic activity indicator and start it.

var actInd = Titanium.UI.createActivityIndicator({
    height:50,
    width:10
});
actInd.show();

Simple Activity Indicator (iOS)

In iOS, the activity indicator must be added to a window or another view to appear.

var actInd = Titanium.UI.createActivityIndicator({
    bottom:10,
    height:50,
    width:10
});
win.add(actInd);
actInd.show();

Methods

Name Summary
addEventListener

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

fireEvent

Fires a synthesized event to any registered listeners.

hide

Hides the activity indicator and stops the animation.

removeEventListener

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

show

Shows the activity indicator and starts the animation.

Properties

Name Type Summary
color String

Color of the message text. (iPhone, iPad, Mobile Web only.)

font Font

Font to use for the message text.

message String

Message text.

messageid String

Key identifying a string from the locale file to use for the message text.

style Number

The style for the activity indicator. (iPhone, iPad only.)

Events

This type has no events.