Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5377] iOS: ScrollView - contentOffset gives an error message

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2017-03-29T22:25:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterKarol Pomaski
AssigneeNeeraj Gupta
Created2011-09-26T14:43:47.000+0000
Updated2017-03-29T22:25:55.000+0000

Description

Problem

While using dynamically ScrollView parameter contentOffset it reponds with an error message in the log window:
[ERROR] Adding an event listener to a proxy that isn't already in the context

Reproducible Steps

1. Execute the sample code 2. Press "Jump To" button 3. Check the log window - ERROR message would appear

Sample Code

var scrollView = Ti.UI.createScrollView({
		showHorizontalScrollIndicator:true, showVerticalScrollIndicator:true,
		width: 250, height: 250, top: 50,
		borderColor:'green', borderWidth:1,
		contentWidth:1000, contentHeight:1000,
		contentOffset: { x:300, y:300}
	});
	
scrollView.add(Ti.UI.createLabel({
	top: 0,
	left: 0,
	width: 500,
	height: 500,
	backgroundColor: "blue",
	text: "test"
}));

var win = Titanium.UI.createWindow({  
    backgroundColor:'#fff'
});

var b2 = Ti.UI.createButton({title:'Jump To', width:100, height:50, bottom: 30});

b2.addEventListener('click', function() {
	scrollView.contentOffset = {x:300, y:300};
});

win.add(scrollView);
win.add(b2);

win.open();

Associated HelpDesk Ticket

http://appc.me/a/APP-858884

Comments

  1. Mattias Lundström 2011-12-21

    I get the same error message but not for the same problem. For me it seems like it has nothing to do with the contentOffset call but with the actual assignment of the listener.
  2. Lee Morris 2017-03-29

    Closing ticket as duplicate of TIMOB-6650 which provides more information.

JSON Source