Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7486] iOS - on modal window orientation misplaces children

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-01T14:58:33.000+0000
Affected Version/sn/a
Fix Version/sSprint 2012-04, Release 2.0.0
ComponentsiOS
Labelsmodule_window, qe-testadded
ReporterPedro Enrique
AssigneeSabil Rahim
Created2012-01-31T15:08:53.000+0000
Updated2012-05-01T14:58:33.000+0000

Description

The Problem:

When the window changes orientation, if it's modal, it's children end up behind the nav bar.

Code Sample:


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

var view = Ti.UI.createView({
	backgroundColor:'white'
});

var label = Ti.UI.createLabel({
	top:0,
	height:10,
	text:'lalalalala'
});

view.add(label);

win.add(view);
	
win.open({modal:true});

To Reproduce:

Run the code above in app.js and rotate the device/simulator

Behavior:

- What happens: View with the label with text "lalalala" ends up under the navbar and invisible to the user - What has to happen: View containing the label has to resize accordingly

Comments

  1. Stephen Tramer 2012-02-24

    *NOTE:* Only check this for correct orienting. There is a bug related to this test, TIMOB-7854, which covers closing and reopening a window over a modal. Any fix for this also needs to pass the "sandwich test" (where the modal is "sandwiched" between two normal windows):
       var toplevel = Ti.UI.createWindow({
       	orientationModes:[
       		Ti.UI.PORTRAIT,
       		Ti.UI.UPSIDE_PORTRAIT
       	],
       	backgroundColor:'white'
       });
       
       var win = Ti.UI.createWindow({
       	orientationModes:[
       		Titanium.UI.LANDSCAPE_LEFT,
       		Titanium.UI.LANDSCAPE_RIGHT
       	],
       	backgroundColor:'white'
       });
       
       var win2 = Ti.UI.createWindow({
       	orientationModes:[Ti.UI.LANDSCAPE_LEFT],
       	backgroundColor:'white'
       });
       
       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() {
       	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);
       win2.add(b4);
       
       toplevel.open();
       
  2. Stephen Tramer 2012-03-02

    Linked to possible regressions.
  3. Wilson Luu 2012-03-15

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120315140247 Titanium Studio, build: 2.0.0.201203142055 xcode: 4.2 Device: iphone 4s (5.0.1)
  4. Wilson Luu 2012-03-15

    Also, only tested the *Code Sample* for correct orientation.
  5. Wilson Luu 2012-03-15

    No regression occurred when testing TIMOB-4619, TIMOB-1634, TIMOB-6551, TIMOB-6391 on: SDK build: 2.0.0.v20120315140247 Titanium Studio, build: 2.0.0.201203142055 xcode: 4.2 Device: iphone 4s (5.0.1), ipad2 (4.3.5)
  6. Natalie Huynh 2012-05-01

    Open to update label

JSON Source