Last Updated: February 25, 2016
·
1.493K
· juanghurtado

Force portrait mode for Android on Appcelerator

Just drop this on your app.js file:

if (Ti.Platform.osname.match(/android/g)){
    Ti.Gesture.addEventListener('orientationchange', function(e) {
        Ti.Android.currentActivity.setRequestedOrientation(Ti.Android.SCREEN_ORIENTATION_PORTRAIT);
    });
}