UIImagePicker slideshow of images on selection

╄→尐↘猪︶ㄣ 提交于 2019-12-11 04:17:59

问题


Like the Photos App shows, all albums > all photos in a particular album > single photo view,

even I need a similar kind of a view. I have used UIImagePickerController and easily go to the second step. However, whenever I select an image, I can not show a slide show kind of a view, as UIImagePicker does not give me that.

I made another view controller , just to display these images in a pagenation form.

But, from the delegate method, didFinishPickingMediaWithInfo, when an image is selected, I get only that image using:

[info objectForKey:UIImagePickerControllerOriginalImage];

How do I know the images next to this image, and before this image, so that I can create a slide show?


回答1:


Check out the documentation for ALAssetsLibrary. To obtain a list of images or videos in the Photo library you would use the enumerateGroupsUsingTypes:usingBlock:failureBlock: method of an ALAssetsLibrary object. For instance, you could call this method, then as it asynchronously returns images and video you would build your array of images for the slideshow view.

Also check out this SO thread. The answer shows how to get an ALAsset object from the UIImagePickerController, which lets you find the URL of the image and other info about it.



来源:https://stackoverflow.com/questions/15360209/uiimagepicker-slideshow-of-images-on-selection

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