2015-11-20 37 views
0

在我的應用程序中,我使用SDWebImageView,我必須在表格中顯示用戶列表,每個用戶都有6個圖像。所以我必須展示每一個圖像。 我使用下面的代碼在屏幕上爲圖像添加動畫。如何使用UIImage的NSUrl intead數組來設置UIImageView的動畫效果?

[smallDpImageV setImage:[UIImage animatedImageWithImages:_dynamicImageArray duration:time]]; 
[smallDpImageV startAnimating]; 

它在這裏接收一個uiimage數組,每個圖像都是由一個URL創建的。但對於tableview我不想在uiimage上創建多個數組。

我可以用NSUrl嗎?像這樣

[imgV sd_setImageWithURL:[dict valueForKey:@"thumb_nail"] placeholderImage:[UIImage imageNamed:@"1447851886_male3.png"]]; 

回答

0

我用SDWebImageView找到了我的答案。

for (NSDictionary *dict in [mainDict valueForKey:@"profile_pic"]) { 
    [imgArr addObject:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[dict valueForKey:@"thumb_nail"]]]]; 
} 
if (imgArr.count >0) { 
    [cell.imgViewUserImage sd_setAnimationImagesWithURLs:imgArr]; 
    cell.imgViewUserImage.animationDuration = imgArr.count*2; 
    [cell.imgViewUserImage startAnimating]; 
} 
相關問題