图片选择器 - Android从相册同时选取多张图片并显示在GridView中
阿神
阿神 2017-04-17 15:30:44
0
3
600

现在想实现一个功能,类似微信发朋友圈,同时选取相册中的多张图片,取得图片的path,选取完成后,显示在一个编辑界面的「gridview」上。
大致网上找下,好像系统默认只能选取一张图片。网上的解决方案是自己写一个图片选择界面,先把图片都读取到自己的界面中,然后再选择。

请问下,有什么好的解决办法吗?谢谢

阿神
阿神

闭关修行中......

reply all(3)
迷茫

Imitation WeChat image selector
https://github.com/lovetuzitong/MultiImageSelector
Now this open source control has been used in our products, and judging from the current feedback, the effect is still good.

左手右手慢动作

Photo picker imitating WeChat
https://github.com/donglua/PhotoPicker

Ty80

WeChat also implements its own picture selection interface. The system only provides the resource ContentProvider, and the application needs to obtain the resource by matching the Uri. For example, to get all jpg and png images on the machine, you can search like this

Cursor cursor = mContentResolver.query(mImageUri,
                new String[]{MediaStore.Images.Media.DATA}, MediaStore.Images.Media.MIME_TYPE + "=? or "
                        + MediaStore.Images.Media.MIME_TYPE + "=? or " + MediaStore.Images.Media.MIME_TYPE + "=?",
                new String[]{"image/jpg", "image/jpeg", "image/png"},
                MediaStore.Images.Media.DATE_MODIFIED);

Traverse the cursor to get all image paths.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template