我什么时候应该使用UIImagePickerControllerSourceTypePhotoLibrary而不是UIImagePickerControllerSourceTypeSavedPhotosAlbum? [英] When should I use UIImagePickerControllerSourceTypePhotoLibrary instead of UIImagePickerControllerSourceTypeSavedPhotosAlbum?
问题描述
我有一个应用程序,允许用户从他们的设备中选择一张照片。要做到这一点,我正在使用UIImagePickerController,但问题是我不确定我是否应该使用 UIImagePickerControllerSourceTypePhotoLibrary
或的源类型UIImagePickerControllerSourceTypeSavedPhotosAlbum
。
I have an application that allows the user to pick a photo from their device. To do this, I'm using the UIImagePickerController, but the problem is that I'm unsure whether I should be using a source type of UIImagePickerControllerSourceTypePhotoLibrary
or UIImagePickerControllerSourceTypeSavedPhotosAlbum
.
在运行iOS 5的iPhone 4上,保存的相册提供了更好的体验,但是当我尝试使用我同步的照片运行iOS 4.3的iPod Touch时从iTunes,它甚至没有出现。如果我切换到 PhotoLibrary
我的iPod有效,但我的iPhone体验更糟糕。当我问 UIImagePickerController
时,它说我的iPod上有 SavedPhotosAlbum
,但我似乎没有确定它是空的方法。
On my iPhone 4 running iOS 5 the saved photos album gives a much better experience, but when I try to use my iPod Touch running iOS 4.3 using a photo that I synced from iTunes, it doesn't even show up. If I switch to PhotoLibrary
my iPod works but my iPhone experience is worse. When I ask the UIImagePickerController
it says the SavedPhotosAlbum
is available on my iPod, but I don't seem to have a way to determine that it's empty.
确定使用哪种源类型的最佳方法是什么?如果我有办法确定保存的相册是否为空,我想这可行,但我没有看到。
What is the best way to determine which source type to use? If I have a way to determine if the Saved Photo Album is empty, I guess that would work, but I don't see one.
推荐答案
UIImagePickerControllerSourceTypePhotoLibrary
引用整个照片库,让用户选择哪个相册。 UIImagePickerControllerSourceTypeSavedPhotosAlbum
直接进入相机胶卷相册,而不让用户选择可供选择的相册。他们是相似的,但不同。您可以从 PhotoLibrary
进入相机胶卷;您可以从 UIImagePickerControllerSourceTypeSavedPhotosAlbum
访问仅相机胶卷。
UIImagePickerControllerSourceTypePhotoLibrary
references the entire photo library, letting the user choose which album. UIImagePickerControllerSourceTypeSavedPhotosAlbum
goes straight to the camera roll album without giving the user a choice as to which album to choose from. They're similar, but different. You can get to the camera roll from PhotoLibrary
; you can access only the camera roll from UIImagePickerControllerSourceTypeSavedPhotosAlbum
.
参考。
这篇关于我什么时候应该使用UIImagePickerControllerSourceTypePhotoLibrary而不是UIImagePickerControllerSourceTypeSavedPhotosAlbum?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!