Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8070] iOS: Modal windows are clipped / incorrectly oriented

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-04T10:37:15.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsios, module_window, qe-testadded
ReporterSabil Rahim
AssigneeMax Stepanov
Created2012-03-16T16:59:49.000+0000
Updated2012-04-04T10:37:15.000+0000

Description

In the following code the windows opened are never cleared out from memory which can cause memory as well as orientation issues as we check the last window on the stack to find the current orientation.

Steps to reproduce

1. Click open on Blue window 2. Click close on Green Window.

Expected Result:

Blue window is orientated and filling the screen.

Actual Result:

Blue window is clipped.
var toplevel = Ti.UI.createWindow({
	orientationModes:[
		Ti.UI.PORTRAIT,
		Ti.UI.UPSIDE_PORTRAIT
	],
	backgroundColor:'blue'
});

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
});
b.addEventListener('click', function() {
	win.open({modal:true});
});

var b2 = Ti.UI.createButton({
	title:'open',
	width:100,
	height:50,
	top:20
});
b2.addEventListener('click', function() {
	var win2 = Ti.UI.createWindow({
	orientationModes:[Ti.UI.LANDSCAPE_RIGHT],
	backgroundColor:'red'
    });
    var b4 = Ti.UI.createButton({
	title:'close',
	width:100,
	height:50,
	bottom:20
    });
    win2.add(b4);
    b4.addEventListener('click', function() {
        win2.close();
    });

    
    
    
    win2.open();
});

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

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

toplevel.add(b);
win.add(b2);
win.add(b3);


toplevel.open();

Comments

  1. Blain Hamon 2012-03-20

    Pull #1691 merged
  2. Michael Pettiford 2012-03-21

    Closing issue Tested with Ti Studio build 2.0.0.201203202130 Ti Mob SDK 2.0.0.v20120321071752 hash r4c936bac OSX Lion 10.7.3 iPone 4S OS 5.1 Expected result is shown
  3. Michael Pettiford 2012-04-04

    Reopening/closing to add/remove labels

JSON Source