如何扭转viewPager的方向从左到右的顺序? [英] how to reverse the direction of viewPager to left to right order?

查看:272
本文介绍了如何扭转viewPager的方向从左到右的顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有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.

推荐答案

你为什么不扭转的名单,你鉴于寻呼机查看和使用<一个href="http://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem%28int%29"相对=nofollow> setCurrentItem(INT)或<一href="http://developer.android.com/reference/android/support/v4/view/ViewPager.html#setCurrentItem%28int,%20boolean%29"相对=nofollow> setCurrentItem(INT,布尔)并设定最后一个在发射活动/片段。

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的方向从左到右的顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆