Skip to content

Instantly share code, notes, and snippets.

@danang-altastratus
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danang-altastratus/37633384060c73319ba6 to your computer and use it in GitHub Desktop.
Save danang-altastratus/37633384060c73319ba6 to your computer and use it in GitHub Desktop.
/**
* Implementation of the window layout vertical & horizontal
* @author Danang Iswadi
*/
var win = Ti.UI.createWindow({
backgroundColor: 'black',
layout: 'vertical'
});
if (Ti.Platform.Android) {
win.setNavBarHidden(true);
} else {
win.setNavBarHidden(false);
};
var Title = Ti.UI.createLabel({
top: 0,
height: 64,
width: Ti.UI.FILL,
backgroundColor: 'white',
text: 'Horizontal layout view',
color: 'black',
textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER
});
var view1 = Ti.UI.createView({
backgroundColor: 'red',
left: 4,
height: 75,
width: 75,
top: 4
});
var view2 = Ti.UI.createView({
backgroundColor: 'white',
backgroundImage: '/images/appcelerator.png',
left: 4,
height: 75,
width: 75,
top: 4
});
var view3 = Ti.UI.createView({
backgroundColor: 'green',
left: 4,
height: 75,
width: 75,
top: 4
});
var view4 = Ti.UI.createView({
backgroundColor: 'white',
backgroundImage: '/images/alloy.png',
left: 4,
height: 75,
width: 75,
top: 4
});
var view5 = Ti.UI.createView({
backgroundColor: 'blue',
left: 4,
height: 75,
width: 75,
top: 4
});
var view6 = Ti.UI.createView({
backgroundColor: 'white',
backgroundImage: '/images/appcelerator-titanium.png',
left: 4,
height: 75,
width: 75,
top: 4
});
win.add(Title);
win.add(view1);
win.add(view2);
win.add(view3);
win.add(view4);
win.add(view5);
win.add(view6);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment