Disabling animation in ViewPager

后端 未结 4 1627
猫巷女王i
猫巷女王i 2020-12-04 23:09

I\'d like to disable all the animations for the transitions in my custom ViewPager. This view pager contains four tabs -and each tab loads a Fragment

4条回答
  •  天涯浪人
    2020-12-04 23:47

    I finally found out: the issue can be solved by just calling the mViewPager.setCurrentItem(position) with an extra parameter to false, which is the smooth scroll for the ViewPager. After this, the scroll will be done without any smoothing and thus the animations won't be seen.

提交回复
热议问题