Android 中滑动图像的最佳方式
基本上这就是我想知道的事情。
我正在开发一个应用程序,该应用程序将从互联网下载图像并将它们保存在SD卡或数据库中(无关紧要)。之后我希望能够显示这些图像并在它们之间滑动。
示例:
ListView.onItemClick显示具有从1到5的唯一ID的图像。
在开始时图像显示为xml文件的内容或以其他方式显示,但我需要能够在图像周围显示 4 个按钮。
顶部按钮:返回列表视图活动和信息按钮(它)使用有关该图像的一些信息启动另一个活动。
底部按钮:上一张图片,下一张图片(在图像之间滚动)
虽然图像像这样显示,但我希望能够滑动它们也用手指。所以我有两种不同类型的图像幻灯片:用按钮和用手指。
单击其中一张图像后,我想将其全屏显示,并且其周围的所有按钮(上一页、下一页、后退、信息)都消失了。我只想在屏幕上看到图像,没有其他内容。单击后按钮再次出现。
所以我在互联网上进行了研究,但我不太确定如何做那件事。这是让事情发挥作用的最佳方式。这就是为什么我在这里问一个问题。
因此,欢迎任何建议、帮助或有用的信息!
提前致谢!!
So basically here is the thing that I want to know.
I'm working on application which will download images from internet and will save them in sdcard or db (doesn't matter).And after that I want to be able to show these images and swipe between them.
Example :
ListView.onItemClick show image with unique ID from 1-to 5.
At the beginning image shows as a content of xml file or in some other way,but I need to be able to show 4 buttons around the image.
Buttons on top : Back to listview activity and Info button (which) start another activity with some information about that image.
Buttons at bottom : Previous image , Next image (scrolling between the images)
While images are shown like this I want to be able to slide them with fingers too.So i have 2 different types of image slide : with buttons and with fingers.
After I click one of the images I want to make it on full screen and all buttons around it (Prev,Next,Back,Info) are gone.I want to see only the image on the screen,nothing else.And after I click it again the buttons shows up again.
So I made research over the internet and I'm not really sure how to do that thing.Which is the best way to get the things work.That's why I'm asking a question here.
So any suggestions,help or useful information are welcomed!
Thanks in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用gestureoverlayview来处理触摸和滑动检测。
http://developer.android.com/reference/android/gesture/GestureOverlayView.html
You can use gestureoverlayview to handle touch and swipe detection.
http://developer.android.com/reference/android/gesture/GestureOverlayView.html