[TIMOB-7402] Android: ScrollView - ScrollView will not scroll when manually set to vertical layout
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-09T19:37:47.000+0000 |
Affected Version/s | Release 1.8.0.1, Release 1.8.1, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | parity, qe-and012312, reprod |
Reporter | Wilson Luu |
Assignee | Ingo Muschenetz |
Created | 2012-01-25T14:05:02.000+0000 |
Updated | 2020-01-09T19:37:47.000+0000 |
Description
Details:
If the scrollView.width and scrollView.height are manually set to a vertical layout i.e. do not use the layout property, vertical scrollView will not scroll.
Steps to reproduce:
1. Launch code in app.js:
var win = Titanium.UI.createWindow({
layout:'vertical',
backgroundColor:'#fff'
});
var scrollView = Ti.UI.createScrollView({
showHorizontalScrollIndicator:true, showVerticalScrollIndicator:true,
width: 250, height: 100, top: 50,
borderColor:'green', borderWidth:1,
contentWidth:1000, contentHeight:100
});
for(var i=0; i<10; i++) {
for(var j=0; j<10; j++) {
scrollView.add(Ti.UI.createLabel({
top:i*100, left:j*100,
width:100, height:100,
text:i+':'+j, textAlign:'center',
color:'white',
backgroundColor:'#A0' + Number(i%2*8).toString(16) +'0'+ Number(8-j%2*8).toString(16)+'0',
borderColor:'black', borderWidth:1
}));
}
}
var button = Ti.UI.createButton({title:'Flip', width:100, height:50});
button.addEventListener('click', function() {
// bug is here
scrollView.width = 100;
scrollView.height = 250;
scrollView.contentWidth = 100;
scrollView.contentHeight = 1000;
button.title = 'Click again';
});
scrollView.addEventListener('scroll', function() {
//Ti.API.info('Offset: (' + scrollView.contentOffset.x + ', ' + scrollView.contentOffset.y + ')');
});
win.add(scrollView);
win.add(button);
win.open();
2. Press Flip
3. Try scrolling
Actual: ScrollView will not scroll vertically
Expected: Should be able to scroll vertically. Above code was able to run without issue in iOS.
Note:
* Did not test in Rhino
* Bug appears in 1.8.0.1
issue reproduces with sdk 3.0.2 and sdk 3.1.0 .
I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131
It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.