Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10972] iOS 6: Window orientation modes are neglected for second level child window

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-23T11:51:58.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 2.1.3, Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19
ComponentsiOS
Labelsapi, module_window, qe-ios090112, qe-ios6, qe-testadded
ReporterShyam Bhadauria
AssigneeVishal Duggal
Created2012-09-19T03:04:34.000+0000
Updated2013-07-23T11:51:58.000+0000

Description

This is not a regression. It occurs on 2.1.2 also on iOS 6 device/simulator. It works fine on iOS 5. If you have 3 windows - one parent,one child and third one grandchild, each with their set of orientationmodes,then orientationmodes of grandchild window are over ruled by the child window. Steps to reproduce: 1. Use the code below-
var _window = Ti.UI.createWindow({
	orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT],
});

		var aBtn = Ti.UI.createButton({
			title:'open',
			height: 100,
			width: 100
		});
		
		aBtn.addEventListener('click', function(){
			var toplevel = Ti.UI.createWindow({
				orientationModes : [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT],
				backgroundColor : 'blue'
			});

			var btn = Ti.UI.createButton({
				title:'close',
				height: 100,
				width: 100
			});
		
			btn.addEventListener('click', function() {
		    	toplevel.close();
			});
			toplevel.add(btn);
		
			var win = Ti.UI.createWindow({
				orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT],
				backgroundColor : 'green'
			});

			var b = Ti.UI.createButton({
				title : 'open',
				width : 100,
				height : 50,
				bottom:0
			});
			b.addEventListener('click', function() {
				win.open({
					modal : true
				});
			});

			var b3 = Ti.UI.createButton({
				title : 'close',
				width : 100,
				height : 50,
				bottom : 20
			});
			b3.addEventListener('click', function() {
				win.close();
			});

			toplevel.add(b);
			win.add(b3);
			toplevel.open(); 
		});
		
_window.add(aBtn);
_window.open();
2. Click 'open' button 3. Click 'open' button again Expected result: 1. A black window with 'open' button should get displayed in landscape mode. 2. A blue window with 'open' and 'close' button should get displayed in portrait mode. 3. A green window with 'close' button should get displayed in landscape mode. Actual result: 1. A black window with 'open' button gets displayed in landscape mode. 2. A blue window with 'open' and 'close' button gets displayed in portrait mode. 3. A green window with 'close' button gets displayed in portrait mode.

Comments

  1. Blain Hamon 2012-09-20

    Pull merged, checked to see if this was fixed as well.
  2. Tamila Smolich 2012-09-21

    Tested and verified on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20120921141611 Device: iPhone 4S (6.0.GM) A green window with 'close' button gets displayed in landscape mode.
  3. Lokesh Choudhary 2012-09-21

    Verified the fix on: MAC OSX 10.8.1 Titanium studio : 2.1.2.201208301612 SDK version : 3.0.0.v20120921144915 xcode 4.5 built with iOS6 SDK on Ipad 3 running iOS6 & on Iphone simulator.
  4. Anshu Mittal 2013-07-23

    Reopening to update labels
  5. Anshu Mittal 2013-07-23

    Tested with: SDK:3.1.2.v20130718094558 Appcelerator Studio: 3.1.2.201307121651 OS: OSX 10.7.5 Device:iPadmini(ios6) Xcode: 4.6

JSON Source