Created
August 10, 2011 01:30
-
-
Save jonalter/1135810 to your computer and use it in GitHub Desktop.
CoverFlowView with borders on remote images
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
| var win = Ti.UI.createWindow({ | |
| backgroundColor: 'blue' | |
| }); | |
| var getImage = function(e){ | |
| var iv = Ti.UI.createImageView({ | |
| image: 'http://example.com/'+e+'.jpg', | |
| borderColor: 'red', | |
| borderWidth: 5, | |
| top: 1000 | |
| }); | |
| iv.addEventListener('load', function(){ | |
| Ti.API.info('loaded image ['+e+']'); | |
| view.setImage(e, iv.toImage() ); | |
| }); | |
| // must add the imageView to the window so that it will load the image | |
| win.add(iv); | |
| } | |
| var images = []; | |
| for (var c=0;c<30;c++){ | |
| images[c] = 'KS_nav_ui.png'; | |
| getImage(c); | |
| } | |
| var view = Titanium.UI.createCoverFlowView({ | |
| images:images, | |
| backgroundColor:'#000', | |
| }); | |
| win.add(view); | |
| win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment