Skip to content

Instantly share code, notes, and snippets.

@bilalq
Created July 3, 2012 18:49
Show Gist options
  • Save bilalq/3041862 to your computer and use it in GitHub Desktop.
Save bilalq/3041862 to your computer and use it in GitHub Desktop.
Titanium Grid for Images
var images = [/*Array of image views with width of 22%*/];
var row;
var grid = Ti.UI.createView({
layout: 'vertical'
});
for (var i=0; i<images.length; i++) {
if (i % 4 == 0) {
row = Ti.UI.createView({
layout: 'horizontal',
height: Ti.UI.SIZE
});
grid.add(row);
}
row.add(images[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment