简体   繁体   English

使用ALAssetsLibrary在某些设备中照片库显示为空

[英]Photo library display empty in some devices using ALAssetsLibrary

// photo gallary or from library  

NSUInteger groupTypes;
groupTypes = ALAssetsGroupAlbum  | ALAssetsGroupLibrary  |        ALAssetsGroupSavedPhotos | ALAssetsGroupPhotoStream  ;
[assetsLibrary enumerateGroupsWithTypes:groupTypes usingBlock:listGroupBlock      failureBlock:failureBlock];

I am trying to fetch images libraries from iPad devices using ALAssetsLibrary. 我正在尝试使用ALAssetsLibrary从iPad设备获取图像库。 From all the fetched libraries, "Photo library" shows empty in some devices. 在所有获取的库中,“照片库”在某些设备中显示为空。

If you are using ALAssetsGroupPhotoStream then it will return asset-url but cannot generate image from that url. 如果您使用的是ALAssetsGroupPhotoStream ,它将返回资产URL,但无法从该URL生成图像。 Because stream assets are not storing their bitmap. 因为流资产未存储其位图。

Instead you should avoid that and get only those images which are store in device. 相反,您应该避免这种情况,只获取存储在设备中的那些图像。

add this line where you allocate your ALAssetsLibrary. 在分配ALAssetsLibrary的位置添加此行。

[ALAssetsLibrary disableSharedPhotoStreamsSupport];

It will not return shared stream photos which are nil. 它不会返回共享的流照片,为nil。

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

相关问题 使用ALAssetsLibrary的空白相册会导致UIButton被隐藏 - Empty photo album using ALAssetsLibrary causes UIButton to be hidden 使用ALAssetsLibrary将照片多次保存到图库会导致崩溃 - Saving photo to library more than once using ALAssetsLibrary causes crash 如何使用ALAssetsLibrary检索照片的文件大小? - How can I retrieve a photo's file size using ALAssetsLibrary? 使用ALAssetsLibrary-CustomPhotoAlbum将照片保存在特定相册中 - using ALAssetsLibrary-CustomPhotoAlbum to save photo in specific Album 检测照片库为空 - Detect Photo Library is empty 如何将图像文件从iOS Photo Library(ALAssetsLibrary)复制到App的本地目录? - How to copy an image file from iOS Photo Library (ALAssetsLibrary) to the local directory of an App? 在静态库中使用ALAssetsLibrary时无法枚举组/结果 - Unable to enumerate groups/results while using ALAssetsLibrary in static library 如何使用ELCImagePickerController和ALAssetsLibrary在照片库中选择多个图像? - How to select multiple images in Photos Library using ELCImagePickerController and ALAssetsLibrary? 如何使用更少的内存在 collectionView 中显示照片库 - How to display photo library in collectionView using less memory ALAssetsLibrary从ALAssetsGroupAll加载单张照片 - ALAssetsLibrary loading a single photo from ALAssetsGroupAll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM