Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1244] iOS forced orientation doesn't rotate screen properly

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionWon't Fix
Resolution Date2015-07-03T23:58:54.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, forced, ios, orientation
ReporterJonas Thoor
AssigneeRadamantis Torres-Lechuga
Created2014-12-03T12:17:19.000+0000
Updated2016-03-08T07:37:37.000+0000

Description

var win = Ti.UI.createWindow({
	orientationModes:	[Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT]
});

var navWin = Ti.UI.iOS.createNavigationWindow({window: win});

var button = Ti.UI.createButton({
	width:	200,
	height:	50,
	title:	"Open Window 2"
});
button.addEventListener("click", function() {
	var win2 = Ti.UI.createWindow({
		orientationModes:	[Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
	});
	navWin.openWindow(win2);
});
win.add(button);

win.open();
First of all this problem only shows on a real device. Start the app in Portrait mode, click the "Open Window 2"-button and place the phone i Landscape mode, press the navigation window back button to return to the first window, this should force the app to be rotated back into Portrait mode according to forced orientation and by just looking at the window it looks correct but if you now place your phone back into Portrait mode the window will rotate once more back into Portrait mode giving a weird effect.

Comments

  1. Radamantis Torres-Lechuga 2015-07-03

    Refer to [orientationModes](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Window-property-orientationModes) *Forcing the orientation of windows inside a NavigationWindow is a bad practice* *OrientationModes must be set before opening the window.*

JSON Source