Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6650] iOS: ScrollView - [ERROR] Adding an event listener to a proxy that isn't already in the context

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2012-02-01T17:46:05.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJon Alter
AssigneeStephen Tramer
Created2011-12-13T16:59:01.000+0000
Updated2017-03-20T22:07:14.000+0000

Description

This error shows in the console log when setting the contentOffset of the scrollView in this example [ERROR] Adding an event listener to a proxy that isn't already in the context. If you comment out the contentOffset in the scroll eventListener, there is no error. Step 1: run the code below Step 2: scroll the view Step 3: notice the error in the console
var win = Ti.UI.createWindow({
	backgroundColor : '#fff'
});

var layer1 = Titanium.UI.createScrollView({
	zIndex : 1,
	contentWidth : 'auto',
	contentHeight : 'auto',
	top : 0,
	layout : 'horizontal',
	contentOffset : {
		x : 0,
		y : 0
	}
});

var controlScroll = Titanium.UI.createScrollView({
	zIndex : 10,
	contentWidth : 1000,
	contentHeight : 480,
	showHorizontalScrollIndicator : true,
	top : 0,
	layout : 'horizontal'
});
controlScroll.addEventListener('scroll', function() {
	var x = controlScroll.contentOffset.x;
	layer1.contentOffset = {
		x : (x * 1.3)
	};
})

for(var i = 0; i < 10; i++) {;
	layer1.add(makeView('blue'));
}

function makeView(color) {
	var view = Ti.UI.createView({
		left : 100,
		width : 20,
		height : 480,
		backgroundColor : color
	});

	return view;
}

win.add(layer1);
win.add(controlScroll);

win.open();

Comments

  1. Roger Mabillard 2012-01-31

    SDK 1.8.1 shows ~ 36 errors - any answer from appcelerator team would be so great
  2. Steve Carpenter 2012-02-01

    I'm getting this error multiple times after updating to SDK 1.8.1, without contentOffset being involved. App appears to run fine.
  3. Arthur Evans 2012-02-01

    Running the sample code, I'm seeing the error even if the entire event listener is commented out. So as Steve says, seems unrelated to contentOffset--or even to adding an event listener.
  4. Tim Poulsen 2012-02-01

    I am seeing this error when using a *ScrollableView* -- it fires each time I switch between child views while running the app. Behavior started with the 1.8.1 builds (first build tried 1.8.1.v20120123161633)
  5. Carl Orthlieb 2012-02-01

    This bug is scheduled for the 1.9 release which is slated for end of March. Should show up in the CI build earlier. Please watch the status of this bug switch to "Resolved" if you want to verify. It will be fixed when the status is marked "Closed".
  6. Stephen Tramer 2012-02-01

    Duplicate of TIMOB-7347.
  7. zouaoui adnene 2012-02-12

    any solution to this problem ? our application can be rejected by Appel ? thanks !
  8. Matthew Delmarter 2012-02-14

    I get this error messages in 1.8.1 when using the scrollTo(X,Y) on a ScrollView. App seems to be working fine. Sounds like this is fixed now?
  9. Arthur Evans 2012-02-28

    This should be fixed in 1.8.2.
  10. Matt Berg 2012-03-02

    This does look to be fixed in 1.8.2, but I do see a very similar error/issue when using backgroundGradient in the constructor for Views.
  11. Lee Morris 2017-03-20

    Closing ticket as duplicate.

JSON Source