Hi friends,
I have created tableview with addevent listener "scroll" event but the CONTENTOFFSET is not supporting for Android it's supporting only iPhone. How can i create tableview scrolling upto last row for Android. Please help me quickly if you have any idea and sample code Please post here.
Below I have shown my current code :
tv.addEventListener('scroll',function(e) { if (Ti.Platform.name === 'iPhone OS'){ var offset = e.contentOffset.y; var theEnd = e.contentSize.height; }else{ var offset = 20000*150; var theEnd = 20000*150; } var height = e.size.height; var total = offset + height; var distance = theEnd - total; if (offset < -65.0 && !pulling && !reloading) { var t = Ti.UI.create2DMatrix(); t = t.rotate(-180); pulling = true; arrow.animate({transform:t,duration:180}); statusLabel.text = "Release to refresh..."; } else if((offset > -65.0 && offset < 0 ) && pulling && !reloading) { pulling = false; var t = Ti.UI.create2DMatrix(); arrow.animate({transform:t,duration:180}); statusLabel.text = "Pull down to refresh..."; } // going down is the only time we dynamically load, // going up we can safely ignore -- note here that // the values will be negative so we do the opposite if (distance < lastDistance) { // adjust the % of rows scrolled before we decide to start fetching var nearEnd = theEnd * .85; if (!updating && (total >= nearEnd)) { beginUpdate(); } } lastDistance = distance; });