Search code examples
titaniumtitanium-mobile

how to customize the orientation in Titanium appcelerator 5.0.2


I want to fix portrait mode in all time I tried it in titanium sdk 4, the code is

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

it is not works in titanium sdk 5.0.2


Solution

  • We have a guide specifically about locking the orientation:

    https://appcelerator.github.io/appc-docs/latest/#!/guide/Orientation