Created
June 20, 2014 15:06
-
-
Save guiled/498e1f613547266dbbce to your computer and use it in GitHub Desktop.
Appcelerator good way to know if in portrait
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
// WTF On iOS for horizontal positions (iPad on a table) there are some bugs : in portrait mode e.source.isPortrait = false, Ti.Gesture.isPortrait = false and Ti.Gesture.orientation = 0 or 5 (even in portrait or landscape) !!! | |
// so take the old fashioned screen dimensions | |
Ti.Gesture.addEventListener('orientationchange', function (e) { | |
Alloy.Globals.isPortrait = (Ti.Platform.displayCaps.platformHeight > Ti.Platform.displayCaps.platformWidth); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment