Created
February 10, 2014 21:58
-
-
Save ricardoalcocer/8925058 to your computer and use it in GitHub Desktop.
Orientation changes
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
| /* | |
| Android: | |
| PORTRAIT 1 | |
| LANDSCAPE 2 | |
| iOS: | |
| PORTRAIT 1 | |
| UPSIDE_PORTRAIT 2 (iOS-only) | |
| LANDSCAPE_LEFT 3 | |
| LANDSCAPE_RIGHT 4 | |
| Full reference: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Window-property-orientationModes | |
| */ | |
| // get startup orientation | |
| $.index.addEventListener('open',function(e){ | |
| console.log("Startup Orientation: " + e.source.orientation); | |
| alert("Startup Orientation: " + e.source.orientation); | |
| }) | |
| // | |
| // listen for orientation changes | |
| Ti.Gesture.addEventListener('orientationchange', function(e) { | |
| console.log("Orientation changed to: " + e.orientation); | |
| alert("Orientation changed to: " + e.orientation); | |
| }); | |
| // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment