如何限制甩在Android的画廊每一扔只是一个项目?只是一个、画廊、项目、Android

2023-09-12 01:47:49 作者:女人活出你的高姿态.丶

我有几个全屏幕图像画廊。我想限制一扔手势只能提前一个图像的时间(像HTC库应用程序)。什么是实现这一目标的右/最简单的方法是什么?

I have a gallery with several full screen images. I want to limit the fling gesture to only advance one image at a time (like the HTC Gallery app). What's the right/easiest way to achieve this?

推荐答案

简单地覆盖画廊Widget的 onFling()方法,不调用超 onFling()方法。

Simply override the Gallery Widget's onFling() method and don't call the superclass onFling() method.

这将使每刷卡画廊提前一个项目。

This will make the gallery advance one item per swipe.