簡體   English   中英

如何在iOS應用程序中的自定義相冊中顯示圖像

[英]How do I display the images in a custom album in my iOS App

我使用下面的代碼創建了一個自定義相冊

(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    <--other code stuffs here-->
    <--selectedImage is the UIImage from Camera or from gallery-->

    [self.library saveImage:selectedImage toAlbum:@"My Album" withCompletionBlock:^(NSError *error)
    {
        if (error!=nil)
        {
            NSLog(@"Big error: %@", [error description]);
        }
    }];
    <--other code stuffs here-->
}

現在我想在我的應用程序中顯示這些保存的圖像。

如何訪問這些圖像,並在我的APP中創建圖庫。

謝謝,

Sujith

您需要的方法是ALAssetsLibrary方法addAssetsGroupAlbumWithName:resultBlock:failureBlock:在此處的文檔中詳細說明: http//developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html #// apple_ref / OCC / CL / ALAssetsLibrary

它是在iOS 5中引入的,並且此后一直沒有被棄用,所以如果它不適合你,我不太清楚它是什么問題。 如果您遇到問題,可能需要更新或重新發布問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM