How to swipe images

前端 未结 7 1177
孤城傲影
孤城傲影 2021-02-05 14:34

I am trying to implement a simple gallery of images in which I have an image to be displayed at a time on the device screen. When we swipe the screen from left to right it shoul

7条回答
  •  粉色の甜心
    2021-02-05 15:12

    I needed the same thing for my app, and used a ViewPager: http://blog.sqisland.com/2012/09/android-swipe-image-viewer-with-viewpager.html

    Previously I used a ImageSwitcher combined with a GestureDetector: http://blog.sqisland.com/2012/07/android-swipe-image-viewer.html

    The code with ViewPager is much simpler, and the experience is much better because the image slides as your finger swipe across the screen. I create ImageView directly, no fragments required.

提交回复
热议问题