[TIMOB-8903] Android: scrollView - does not resize width of content with device is rotated
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-01T13:02:53.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-09 Core |
Components | Android |
Labels | core, module_scrollview, qe-testadded, regression |
Reporter | Jon Alter |
Assignee | Allen Yeung |
Created | 2012-04-26T19:32:50.000+0000 |
Updated | 2012-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));
}
Layout issue. Marking this as core
Tested with 2.1.0.v20120614102250 on Droid 3 2.3.4