var modes = [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT];
var modesEnabled = true;
var tabGroup = Ti.UI.createTabGroup({
orientationModes: modes
});
var tabWindow = Ti.UI.createWindow();
tabGroup.addTab(Ti.UI.createTab({window: tabWindow, title: 'Lonely tab'}));
var toggleModesButton = Ti.UI.createButton({
title: 'Toggle orientationModes'
});
toggleModesButton.addEventListener('click', function() {
tabGroup.orientationModes = modesEnabled ? [ ] : modes;
modesEnabled = !modesEnabled;
});
tabWindow.add(toggleModesButton);
tabGroup.open();
Steps to reproduce:
1.Copy paste the code in app.js.
2.Run the app.
3.Click "Toggle orientationModes" buttonTest steps
Expected result
2. The window should open in landscape mode(supporting both landscape left and landscape right).
3. Now the window should support only portrait mode.
Actual result
3. Clicking the 'toggle orientation mode' does not make the app support Portrait orientation mode.
This is a invalid ticket, Since 3.1.3.GA (window's refactor). Once a window/NavigationGroup/TabGroup is opened you cannot change its orientationMode.
Closing as per above comments.