Time for action – creating an activity indicator
The following example will create a small app with an extra file that contains code to display an activity indicator. Perform the following steps to do so:
Create a new blank mobile project without a template.
Open
app.js
. Clear all of the existing code and replace it with the following, which will create a blank window:var win1 = Titanium.UI.createWindow({ backgroundColor:'#fff' }); win1.open();
Create a new file by navigating to File | New | File, placing the new file in the resources directory. Call the new file
activity.js
as it will contain the code to create the activity indicator. The file will automatically be opened in the editor when it is created.activity.js
will contain code to return an activity indicator. Add the following code to the new file:function activityIndicator(args) { var actInd = Ti.UI.createActivityIndicator({height:50,width:10}); if (Ti.Platform.osname != 'android') actInd.style=Titanium.UI.iPhone...