Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Get X and Y from scrollable view

According to the documentation (http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.ScrollableView-object), I'm supposed to be able to get the TouchStart from a ScrollableView and grab the X and Y coordinates, but it doesn't seem to be working. Am I doing anything wrong?

var win = Titanium.UI.createWindow();
win.navBarHidden=true;


var view1 = Ti.UI.createView({backgroundColor: '#000'});
var view2 = Ti.UI.createView({backgroundColor: '#fff'});
var view3 = Ti.UI.createView({backgroundColor: '#cfcfcf'});

var scrollView = Titanium.UI.createScrollableView({
    views:[view1,view2,view3],
    showPagingControl:false,
    currentPage:0
});
Ti.API.info('test log entry');


win.add(scrollView);

scrollView.addEventListener('click',function(e){
   Titanium.API.info('click');
});

scrollView.addEventListener('swipe',function(e){
   Titanium.API.info('swipe');
});

scrollView.addEventListener('scroll',function(e){
   Titanium.API.info('scroll');
   Titanium.API.info(e.x);
});

scrollView.addEventListener('touchstart',function(e){
   Titanium.API.info('touchstart');
});


win.open();
— asked July 25th 2010 by Ricardo Alcocer
  • android
  • eventlistener
  • scrollableview
0 Comments

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.