Created
September 30, 2012 18:15
-
-
Save Mindelusions/3808043 to your computer and use it in GitHub Desktop.
Titanium - Multi-Column Image View Stack
This file contains 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:'#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