Created
September 29, 2011 20:56
-
-
Save jonalter/1251930 to your computer and use it in GitHub Desktop.
Android: window orientation example for 1.8.x
This file contains hidden or 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 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(); |
This file contains hidden or 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
| Ti.UI.currentWindow.backgroundColor = 'green'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment