简体   繁体   English

从图库中选择图像的Viewpager指示器

[英]Viewpager indicator with images selected from gallery

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). Currenlty我在一个项目中工作,我必须从图库中选择多个图像,并且必须将所有选择的图像显示为可滑动查看的视图(viewpager指示器)。 I have gone through many examples but every where I found static images with viewpager. 我浏览了许多示例,但每个地方都使用viewpager找到了静态图像。 How to show selected images in viewpager with indicator? 如何在带指示器的viewpager中显示所选图像?

I am following this for selecting multiple images https://github.com/luminousman/MultipleImagePick 我正在按照此选择多个图像https://github.com/luminousman/MultipleImagePick 这就是我从图库中选择图像的方式

Use ViewPager with FragmentStatePagerAdapter if you have more data to show or FragmentPagerAdapter . 如果要显示更多数据,请使用带有FragmentStatePagerAdapter的 ViewPager或FragmentPagerAdapter

You can read here about the difference between these two and when to use it. 您可以在此处了解这两者之间的区别以及何时使用它。

Difference between FragmentPagerAdapter and FragmentStatePagerAdapter FragmentPagerAdapter和FragmentStatePagerAdapter之间的区别

Use CircularPageIndicator for images indication. 使用CircularPageIndicator进行图像指示。

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. 现在回到您的问题,您想显示选定的数据或说图像,可以将这些图像传递给viewPager适配器,它将进行处理。

Read here, about how to use FragmentStatePagerAdapter with ViewPager. 在这里阅读有关如何将FragmentStatePagerAdapter与ViewPager一起使用的信息。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM