Viewpager indicator with images selected from gallery

点点圈 提交于 2019-12-11 12:19:10

问题


Currenlty I am working in a project where I have to select multiple images from gallery and have to display all selected images as a swipeable view(viewpager indicator). I have gone through many examples but every where I found static images with viewpager. How to show selected images in viewpager with indicator?

I am following this for selecting multiple images https://github.com/luminousman/MultipleImagePick


回答1:


Use ViewPager with FragmentStatePagerAdapter if you have more data to show or FragmentPagerAdapter.

You can read here about the difference between these two and when to use it.

Difference between FragmentPagerAdapter and FragmentStatePagerAdapter

Use CircularPageIndicator for images indication.

Now coming back to your question, you want to show the selected data or say images, you can pass these images to the viewPager adapter and it will takes care of it.

Read here, about how to use FragmentStatePagerAdapter with ViewPager.

https://guides.codepath.com/android/ViewPager-with-FragmentPagerAdapter



来源:https://stackoverflow.com/questions/35424736/viewpager-indicator-with-images-selected-from-gallery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!