Skip to content

Instantly share code, notes, and snippets.

@guiled
Created June 20, 2014 15:06
Show Gist options
  • Save guiled/498e1f613547266dbbce to your computer and use it in GitHub Desktop.
Save guiled/498e1f613547266dbbce to your computer and use it in GitHub Desktop.
Appcelerator good way to know if in portrait
// 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