0

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

4

1 回答 1

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
于 2013-07-31T07:13:33.273 回答