Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8037] MobileWeb: View - Rotating views causes the view to be redisplayed which results in subviews being redrawn in different locations than they were originally

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-17T16:25:57.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsMobileWeb
Labelsqe-mw020912, qe-port
ReporterMichael Pettiford
AssigneeBryan Hughes
Created2012-03-15T12:36:59.000+0000
Updated2012-08-15T16:39:27.000+0000

Description

Steps to reproduce: 1. Create a default mobile web project and change to app.js code to the following
		var _window = Titanium.UI.createWindow({
			title : 'test',
			backgroundColor : 'white'
		});


_window.orientationModes = [Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.UPSIDE_PORTRAIT];
		var v1 = Ti.UI.createView({
			backgroundColor : '#f00',
			width : '30%',
			left : '20%',
			top : 0,
			height : '100%'
		});

		var v3 = Ti.UI.createView({
			backgroundColor : 'blue',
			width : '80%',
			left : '10%',
			top : '10%',
			height : '80%'
		});

		var v5 = Ti.UI.createView({
			backgroundColor : 'gray',
			width : '60%',
			left : '20%',
			top : '10%',
			height : '80%'
		});

		v3.add(v5);
		v1.add(v3);
		_window.add(v1);

		var v2 = Ti.UI.createView({
			backgroundColor : '#0f0',
			width : '30%',
			right : '20%',
			top : 0,
			height : '100%'
		});

		var v4 = Ti.UI.createView({
			backgroundColor : 'blue',
			width : '80%',
			left : '10%',
			top : '10%',
			height : '80%'
		});

		var v6 = Ti.UI.createView({
			backgroundColor : 'gray',
			width : '60%',
			left : '20%',
			top : '10%',
			height : '80%'
		});

		v4.add(v6);
		v2.add(v4);
		_window.add(v2);
_window.open();
2. Run the app 3. Rotate the device through all landscape and portrait orientations Actual result: After rotating from portrait to landscape then back to landscape the views are drawn at a different location Expected result: The views are redrawn at the same location as they were originally

Comments

  1. Bryan Hughes 2012-03-17

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1724
  2. Lokesh Choudhary 2012-08-15

    Verified fix on: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120814134112 Android 4.0.4 - default ,chrome 18.0 , firefox 14.0.1 Iphone 5.1.1 - safari mobile

JSON Source