Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2312] iOS: scrollview.scrollTo Method broken

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2013-04-01T22:07:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsdefect
ReporterHeburg
AssigneeDaniel Sefton
Created2012-11-25T21:05:09.000+0000
Updated2016-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();

Comments

  1. Pedro Enrique 2013-04-01

    It works as it should. scrollTo needs to be done after the scrollview has been added to the window and the window has opened.

JSON Source