问题
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