Created
December 3, 2013 11:54
-
-
Save csemrm/7767948 to your computer and use it in GitHub Desktop.
Lock window screen in Portrait Android For Android Window screen lock, we need to set orientationModes and orientation property in the window object. we also need to make sure you force a heavyweight window by either setting fullscreen: true or navBarHidden: true.
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 win = Titanium.UI.createWindow({ | |
title : 'My app', | |
backgroundColor : '#fff', | |
navBarHidden : true, | |
orientationModes : [Titanium.UI.PORTRAIT] | |
}); | |
Titanium.UI.orientation = Titanium.UI.PORTRAIT; | |
var testButton = Ti.UI.createButton({ | |
title : 'Test Button', | |
}); | |
testButton.addEventListener('click', function() { | |
alert('\'Test Button\' was clicked!'); | |
}); | |
win.add(testButton); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment