问题描述
我有几个视图的 viewPager.viewPager 的默认行为是首先显示第一项,然后从右向左滑动显示第二个视图,以此类推.
I have viewPager with several views. the default behavior of viewPager is that the first item is displayed first, then swiping right to left displays the second view right to the current view etc.
我想要的行为是在显示第一个项目后,从左向右滑动将显示下一个视图从左到当前项目.
the behavior i want is that after the first item is displayed, swiping left to right will display the next view left to the current item.
我搜索了很多聪明的方法来实现这个但没有结果..
提前致谢.
i searched a lot for clever way to implement this but no results..
thanks in advance.
推荐答案
你为什么不反转你在视图分页器中查看的列表并使用 setCurrentItem(int) 或 setCurrentItem(int,boolean) 并在活动/片段启动时设置最后一个..
why don't you reverse the list of you view in view pager and use setCurrentItem(int) or setCurrentItem(int,boolean) and set the last one at the launch of the activity/fragment..
这篇关于如何将 viewPager 的方向反转为从左到右的顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!