0

我有一个带有 ViewPager 的布局以及 ViewPager 内的左右箭头,用于手动移动到下一个视图而无需滑动。当用户滑动时,我想隐藏那些箭头(或者当用户向右滑动时可能只显示正确的箭头......)

如何确定用户是否正在滚动 ViewPager?

4

1 回答 1

0

Found the solution:

Method onPageScrollStateChanged from SimpleOnPageChangeListener

http://developer.android.com/reference/android/support/v4/view/ViewPager.SimpleOnPageChangeListener.html#onPageScrollStateChanged(int)

the state argument of onPageScrollStateChanged is 1 when you start draggin, 2 when you let go and 0 when the ViewPager has stopped scrolling

于 2013-04-03T15:54:53.157 回答