代码改变世界

手势检测的回调方法中onfling与onscroll的区别

2015-03-17 17:28  徐亮  阅读(702)  评论(0编辑  收藏  举报

onfling参数:

e1 The first down motion event that started the fling.

e2 The move motion event that triggered the current onFling.

velocityX The velocity of this fling measured in pixels per second along the x axis.

velocityY The velocity of this fling measured in pixels per second along the y axis.

onscroll参数:

e1 The first down motion event that started the scrolling.

e2 The move motion event that triggered the current onScroll.

distanceX The distance along the X axis that has been scrolled since the last call to onScroll. This is NOT the distance between e1 and e2. distanceY The distance along the Y axis that has been scrolled since the last call to onScroll. This is NOT the distance between e1 and e2.

从两者的参数可以看出 onfling强调滑动的速度, 适用于响应对速度有需求的事件

onscroll强调滑动的距离, 适用于响应对距离有需求的事件