简体   繁体   English

无限画廊中的 OnItemLongClick

[英]OnItemLongClick in Infinite Gallery

I am creating an Image gallery for my Android app and I need it to loop through images infinitely.我正在为我的 Android 应用程序创建一个图像库,我需要它来无限循环图像。 To achieve this I am using the Infinite Gallery widget found here (Code is here ).为了实现这一点,我正在使用此处找到的无限画廊小部件(代码在此处)。 The gallery works very well, however I am having trouble implementing a long press function.画廊运作良好,但我无法实现长按 function。 I am not trying to create a context menu, just trying to call another method.我不是想创建上下文菜单,只是想调用另一种方法。

Adding an onItemClickListener to the InfiniteGallery object in InfiniteGalleryActivity has not worked.在 InfiniteGalleryActivity 中向 InfiniteGallery object 添加 onItemClickListener 无效。

Have you tried with the GestureDetector.OnGestureListener, implementing the onLongPress(MotionEvent e)??您是否尝试过使用 GestureDetector.OnGestureListener,实现 onLongPress(MotionEvent e)?

Information right here: http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html信息就在这里: http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html

Hope this helps you out =)希望这可以帮助你=)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM