How to swipe images

前端 未结 7 1194
孤城傲影
孤城傲影 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条回答
  •  旧时难觅i
    2021-02-05 15:26

    You want to use a ViewPager available in the Android Support Jar. Here is a tutorial: http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/

    You dont want use Gallery as some suggest as its not deprecated. However from the documentation they suggest the ViewPager and HorizantleScrollView to solve this problem relatively easily:

    This class is deprecated.
        This widget is no longer supported. Other horizontally scrolling widgets include
        HorizontalScrollView and ViewPager from the support library.
    

提交回复
热议问题