Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created August 10, 2011 01:30
Show Gist options
  • Select an option

  • Save jonalter/1135810 to your computer and use it in GitHub Desktop.

Select an option

Save jonalter/1135810 to your computer and use it in GitHub Desktop.
CoverFlowView with borders on remote images
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