Titanium Scrollable Viewの動きをみてみた時のコード
var win = Ti.UI.createWindow();
var view1 = Ti.UI.createView({
backgroundColor : '#123',
});
var view2 = Ti.UI.createView({
backgroundColor : '#246'
});
var view3 = Ti.UI.createView({
backgroundColor : '#48b'
});
var scrollableView = Ti.UI.createScrollableView({
views : [view1, view2, view3],
showPagingControl : true
});
win.add(scrollableView);
win.open();
Ti.API.info('custom x', view1.x);
Ti.API.info('custom y', view1.y);
Ti.API.info(JSON.stringify(view1.rect));
view1.addEventListener('scroll', function (e){
Ti.API.info('swipe x', e.x);
Ti.API.info('swipe y', e.y);
});
Ti.App.addEventListener("scroll_hook",function(e){
Ti.API.info('custom x', view1.rect.x);
Ti.API.info('custom y', view1.rect.y);
Ti.API.info('custom e ',JSON.stringify(e));
});
scrollableView.addEventListener('scroll', function (e) {
Ti.App.fireEvent('scroll_hook');
Ti.API.info('-------------info-----------');
Ti.API.info('e', JSON.stringify(e));
Ti.API.info('width', e.source.width);
Ti.API.info('height', e.source.heigh);
Ti.API.info('currentPage', e.source.currentPage);
Ti.API.info('source x', e.source.x);
Ti.API.info('x', e.x);
//Ti.API.info('views', e.source.view);
Ti.API.info('source', JSON.stringify(e.source));
var view = e.source.views[e.source.currentPage];
Ti.API.info('view', JSON.stringify(view));
});
scrollableView.addEventListener("scrollEnd", function (e) {
Ti.API.info('end', JSON.stringify(e));
});