从 GridView 调用的全屏图像浏览器
我有一个 GridView 活动,由一个 GridView 组成,该 GridView 显示来自 sdcard 位置的最多 100 个图像缩略图。我正在创建另一个活动,当触摸网格中的任何一个缩略图时调用该活动。此其他活动应全屏显示所选图像(可以通过将图像 uri 传递给新活动来实现此目的)。但是,我希望能够从所选图像的全屏视图向左/向右滑动以转到下一张图像,而不是返回到 gridview 活动并选择另一张图像进行全屏显示。
如何实现使用滑动手势从 SD 卡位置提取图像以进行全屏浏览的图像浏览器活动?
I have a GridView activity consisting of a single GridView that displays upto 100 image thumbnails from an sdcard location. I am creating another activity which is called when any one of the thumbnail in the grid is touched. This other activity should display the selected image in full-screen (can do this by passing the image uri to new activity). However, I would like to be able to swipe left/right from the full-screen view of the selected image to go to the next one instead of going back to the gridview activity and selecting another image for full-screen display.
How can I achieve this image browser activity that pulls images from the sdcard location for full-screen browsing using swipe gesture?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 ViewFlipper
You may use a ViewFlipper
ViewPager
,它是一个像 AdapterView 一样的 ViewGroup,并为您完成所有滑动手势管理工作另外,这是来自 Android 开发者博客的示例这可能会让你开始。
华泰
ViewPager
, which is a ViewGroup that acts like an AdapterView and does all the swipe gesture management work for youAlso, here is an example from the Android Developer Blog that may get you started.
HTH