[AC-2312] iOS: scrollview.scrollTo Method broken
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-04-01T22:07:25.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | defect |
Reporter | Heburg |
Assignee | Daniel Sefton |
Created | 2012-11-25T21:05:09.000+0000 |
Updated | 2016-03-08T07:41:19.000+0000 |
Description
*Problem description*
scrollTo method doesn't accept an x/y parameter which is inside a variable.
*Test case*
var mainWindow = Ti.UI.createWindow();
var scrollview = Titanium.UI.createScrollView({
width : Ti.UI.FILL,
height : Ti.UI.FILL
});
var container = Titanium.UI.createView({
height : 3000,
width : Ti.UI.FILL,
backgroundColor : '#FFF'
});
scrollview.add(container);
var scrollpoint = 1500;
scrollview.scrollTo(0, scrollpoint); // this doesn't work
//scrollview.scrollTo(0, 1500); // this does work
mainWindow.add(scrollview);
mainWindow.open();
It works as it should. scrollTo needs to be done after the scrollview has been added to the window and the window has opened.