Details
-
Type:
Bug
-
Status: Closed
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: Release 1.8.0.1, Release 1.8.1
-
Fix Version/s: Sprint 2012-03, Release 2.0.0, Release 1.8.2
-
Component/s: Android
-
Labels:
-
Environment:
SDK build: 1.8.0.1, 1.8.1.v20120124200134
Runtime: v8, rhino
OS: Mac OS X Lion (10.7.2)
Titanium Studio, build: 1.0.8.201201210622
Device: Nook Color (2.2)
Description
Steps to reproduce:
1. Launch the following code in app.js:
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() {
|
scrollView.width = 100;
|
scrollView.height = 250;
|
|
scrollView.contentWidth = 100;
|
scrollView.contentHeight = 1000;
|
|
button.title = 'Click again';
|
|
});
|
|
scrollView.addEventListener('scroll', function() {
|
// bug is here
|
Ti.API.info('Offset: (' + scrollView.contentOffset.x + ', ' + scrollView.contentOffset.y + ')');
|
});
|
win.add(scrollView);
|
win.add(button);
|
win.open();
|
Actual: Runtime error occur. See attachment.
Expected: Should not get a runtime error. Above code ran without error in iOS
Note: Occurs in 1.8.0.1
Attachments
Issue Links
- relates to
-
TIMOB-5861 iOS: scrollView is not updated correctly.
-
- Closed
-