Although Appcelerator Titanium makes much of the hard work of integrating with numerous operating systems and devices invisible to you, the developer, there are going to be times when you simply have to write some code that is platform specific. The most common way to do this is by checking the osname
property from the Titanium.Platform
namespace.
In this recipe we will create a simple screen the shows a custom activity indicator when the device is an iPhone, and a standard indicator when the user is on an Android device.
Open your app.js
file, remove any existing code, and type in the following:
// create root window var win1 = Titanium.UI.createWindow({ title: 'Tab 1', backgroundColor: '#fff' }); ///this next bit is a custom activity indicator for iphone ///due to too many diffs between android and ios ones var actIndIphone...