Skip to content

Instantly share code, notes, and snippets.

@Mindelusions

Mindelusions/app.js

Created Sep 30, 2012
Embed
What would you like to do?
Titanium - Multi-Column Image View Stack
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var leftView = Ti.UI.createView({
width:'48%',
height:Ti.UI.FILL,
left:0,
backgroundColor:'#dfdfdf',
layout:'vertical'
});
var rightView = Ti.UI.createView({
width:'48%',
height:Ti.UI.FILL,
right:0,
backgroundColor:'#dfdfdf',
layout:'vertical'
});
var imgs = [
'http://mindelusions.com/img/banner.png',
'http://mindelusions.com/img/rfp.png'
];
for (var i = 0; i < 5; i++) {
var lidx, ridx;
if (i % 2 == 0) {
lidx = 0;
ridx = 1;
} else {
lidx = 1;
ridx = 0
}
limg = Ti.UI.createImageView({
image:imgs[lidx],
width:Ti.UI.FILL
});
rimg = Ti.UI.createImageView({
image:imgs[ridx],
width:Ti.UI.FILL
});
leftView.add(limg);
rightView.add(rimg);
}
win.add(leftView);
win.add(rightView);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment