移动图库视图下一个图像上一刷卡Android中? [英] Moving the Gallery view to the next image on one swipe in Android?

查看:133
本文介绍了移动图库视图下一个图像上一刷卡Android中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在画廊查看四象。当我们从左至右或从右到左的画廊查看刷卡移动所有的图像,即,如果我从左至右,从第一张图像右轻扫,然后它会移动到所有四个图像。

I have four images in the Gallery View. When we do swipe from left to right or right to left the Gallery View moves all the images i.e if I swipe from left to right from the first image then it will move to all the four images.

我要的是,当我刷它应该只移动到下一个图像。有人可以让我知道,这怎么可能?

What I want is that when I swipe it should only move to the next image. Can someone let me know how is this possible?

希望能得到答复很快。

问候 苏尼尔

推荐答案

我通过创建一个 CustomGallery 类扩展来实现这个图库。然后我推翻图库 onFling 方法。在 onFling 的方法,简单地返回false。这将导致画廊只有移动的时候 onFling 被称为下一个图像。

I accomplished this by creating a CustomGallery class that extends Gallery. I then Overrode the onFling method of Gallery. Inside the onFling method, simply return false. This will cause the Gallery to only move to the next image when onFling is called.

这篇关于移动图库视图下一个图像上一刷卡Android中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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