使用developer.android.com中的ScreenSlider。如何跳转到特定页面?

时间:2013-07-31 07:03:21

标签: android animation android-fragments

我正在使用像此http://developer.android.com/training/animation/screen-slide.html这样的ScreenSlider。它完全在我使用5页的地方运行。现在我想要的是直接从一个页面跳转到另一个页面。例如,用户在2页,点击按钮跳到5页。我怎么能实现这一点。有没有预定义的方法。请帮忙吗?

1 个答案:

答案 0 :(得分:1)

使用setCurrentItem http://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem(int

mViewPager.setCurrentItem(4) // For moving to 5th page

mViewPager.setCurrentItem(4, true) // move with with animation
相关问题