Skip to content

Instantly share code, notes, and snippets.

@jonalter
Created September 29, 2011 20:56
Show Gist options
  • Select an option

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

Select an option

Save jonalter/1251930 to your computer and use it in GitHub Desktop.
Android: window orientation example for 1.8.x
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff',
fullscreen: true,
});
// orientationModes needs to be set after the createWindow
win1.orientationModes = [Ti.UI.PORTRAIT];
var b1 = Titanium.UI.createButton({
title : 'Win 2',
height : 40,
width : 200,
top : 30
});
win1.add(b1);
b1.addEventListener('click', function(e) {
var w = Titanium.UI.createWindow({
// fullscreen true will make this a heavyweight window
// fullscreen : true,
url:'win.js',
barColor : '#111',
});
// set orientationModes for the window if you make it heavyweight
// w.orientationModes = [Ti.UI.PORTRAIT];
w.open();
w.addEventListener('click', function(e){
w.close();
});
});
win1.open();
Ti.UI.currentWindow.backgroundColor = 'green';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment