ScrollableView not firing 'scroll' event always

You must Login before you can answer or comment on any questions.

When scrolling quickly on a scrollableView the scroll event does not fire all the time. Here's an app.js that you can test:

var win = Titanium.UI.createWindow({  
    backgroundColor:'#fff'
});
 
var views_arr = [];
 
for(var i=0; i<10; i++){
    views_arr[i] = Ti.UI.createView({
        width: 200,
        height: 100,
        borderColor:'#000' 
    });
    var lbl = Titanium.UI.createLabel({
        text:'view '+i,
        color:'#000',
    });
    views_arr[i].add(lbl);
}
 
scrollableView = Titanium.UI.createScrollableView(
{
    views: views_arr,
    top: 0,
    left: 0,
    right: 0,
    borderWidth: 0,
    showPagingControl:true
});
 
scrollableView.addEventListener('scroll', function(e)
{
    Ti.API.info("Image Scrolled current page: " + e.currentPage);
});
 
win.add(scrollableView);
win.open();
When looking at the log:
[INFO] scrollable-event/1.0 (1.6.1.2fdc0c5)
[INFO] Image Scrolled current page: 1
[INFO] Image Scrolled current page: 2
[INFO] Image Scrolled current page: 6
[INFO] Image Scrolled current page: 7
[INFO] Image Scrolled current page: 8
This has been tested on Ti 1.6.1 and iPhone 4.2

A similar question: http://developer.appcelerator.com/question/86241/titaniumuiscrollableview-not-firing-event-in-view-change

1 Answer

I've added a ticket (because this is a bug) in lighthouse

— answered 4 years ago by Daniel Tome
answer permalink
1 Comment
  • Have u had any feedback on this bug. I couldn't see any in the ticket. This is a huge failure as this functionality is very common. I'm also having the exact same issue and can't find any workarounds.

    — commented 4 years ago by Andreas Oberg

Your Answer

Think you can help? Login to answer this question!