Created
May 10, 2011 14:05
-
-
Save dawsontoth/964526 to your computer and use it in GitHub Desktop.
Loading images in @appcelerator #Titanium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The images for this example can be downloaded from http://j.mp/loadingimagesforti */ | |
var win = Ti.UI.createWindow({ backgroundColor: '#f00'}); | |
var loading = Ti.UI.createImageView({ | |
images: [ | |
'images/loading/00.png', 'images/loading/01.png', 'images/loading/02.png', | |
'images/loading/03.png', 'images/loading/04.png', 'images/loading/05.png', | |
'images/loading/06.png', 'images/loading/08.png', 'images/loading/09.png', | |
'images/loading/10.png', 'images/loading/11.png' | |
], | |
width: 33, height: 33 | |
}); | |
loading.start(); | |
win.add(loading); | |
win.open(); |
I just updated the sample images (it's a zip) to have retina images as well. I made these images, so there aren't any royalty issues to face. Use the images at your own risk, don't sue me, yada yada yada.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You might say, "Why not use an activity indicator?" That works fine on iOS. But on Android a modal alert pops up and blocks the user from interacting with the app! If you use the above sample instead of an activity indicator, you can deliver the same experience to both platforms, and you aren't so intrusive on Android.