简体   繁体   English

如何在单个活动中获取可滑动的imageViews?

[英]How to obtain the swipable imageViews in a single activity?

I want to make an activity where i want to use multiple images and want to swipe it in the same activity. 我想进行一项活动,在该活动中我想使用多张图像,并希望在同一活动中对其进行滑动。

can anyone help me with the code here because im new to android and i tried reading the gesture class but couldnt figure out the proper solution.. 谁能在这里提供代码帮助,因为我是android的新手,所以我尝试读取手势类,但找不到正确的解决方案。

i have four imageViews with me and using a single activity class would like to change the views using a swipe!!! 我有四个imageViews,并且使用单个活动类想通过滑动来更改视图!

i also tried using the gestureDetector class but it is deprecated from android!! 我也尝试过使用gestureDetector类,但是它已被android系统弃用!

The easiest way is to create a GalleryView and provide a gallery adapter that contains the images you want to display and you can also slide them with the finger without any need of gesture recognition. 最简单的方法是创建GalleryView并提供一个图库适配器,其中包含要显示的图像,您也可以用手指滑动它们而无需任何手势识别。

Have a look at this link http://saigeethamn.blogspot.de/2010/05/gallery-view-android-developer-tutorial.html 看看这个链接http://saigeethamn.blogspot.de/2010/05/gallery-view-android-developer-tutorial.html

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

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