多次调用 Viewpager PageScrollStateChanged

Viewpager PageScrollStateChanged called multiple times

我想知道ViewPager的事件PageScrollStateChanged在滑动viewpager时被调用3次是否正常

是的,这是正常行为。 3次arg0的含义如下

   1 for begins dragging
   2 is when the pager is automatically settling to the current page
   0 fully stopped/idle.

如果你想只在滚动时执行代码,你可以在“if(arg0==1)”块中编写代码。