Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8903] Android: scrollView - does not resize width of content with device is rotated

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-01T13:02:53.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0, Sprint 2012-09 Core
ComponentsAndroid
Labelscore, module_scrollview, qe-testadded, regression
ReporterJon Alter
AssigneeAllen Yeung
Created2012-04-26T19:32:50.000+0000
Updated2012-07-09T14:28:26.000+0000

Description

The view in a scrollView does not resize correctly when the window it is in is rotated to landscape and then back to portrait. Broken on 2.1.0 Working on 1.8.2

Steps to repro:

Step 1: run the code Step 2: hold the device in portrait and launch the app Step 3: notice the red views on the left and right of the screen Step 4: rotate the device to landscape Step 5: notice the red views move out and stay at the sides of the screen Step 6: rotate the device back to portrait Step 7: notice that the views on the right side are missing (they should have moved back in to be at the side of the screen) Step 8: repeat the steps above with TiSDK 1.8.2 to see the correct behavior
var win = Ti.UI.createWindow({backgroundColor: 'blue'});
win.open();

var scrollView = Ti.UI.createScrollView({
	left:0,
	top:0,
	right:0,
	bottom:0,
	contentHeight:'auto',
	backgroundColor: 'green'
});
win.add(scrollView);

var innerView = Ti.UI.createView({
	height:Ti.UI.SIZE,
	layout:'vertical',
	left:0,
	top:0,
	right:0
});
scrollView.add(innerView);

for(var i = 0; i < 10;  i++){
	var params = {
		backgroundColor: 'red',
		top: 5,
		height: 20,
		width: 100,
	}
	
	if(i%2 === 0){
		params.left = 5;
	}else{
		params.right = 5;
	}
	
	innerView.add(Ti.UI.createView(params));
}

Comments

  1. Vishal Duggal 2012-04-30

    Layout issue. Marking this as core
  2. Natalie Huynh 2012-06-15

    Tested with 2.1.0.v20120614102250 on Droid 3 2.3.4

JSON Source