开发者

How to detect scrolling action in Android?

I have a horiz开发者_开发问答ontal scroll view, and I want to detect a scrolling action ,

1) is there a listener to detect when the user make scrolling ?

2) and can I know whether the scroll is left to right or right to left ?

EDIT :what is the required listener in HorizontalScrollView ? I don't find OnScrollListener !


You need to go for Gestures. You will have callback methods like

  1. onScroll(MotionEvent e1, MotionEvent e2, float distanceX,float distanceY)
  2. onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜