gpt4 book ai didi

ios - 我希望 collectionview 单元格上有事件指示器,直到从网络服务器加载图像

转载 作者:行者123 更新时间:2023-11-29 03:17:42 25 4
gpt4 key购买 nike

我怎么知道我什么时候得到数据,现在什么时候我需要隐藏 activity indicator 和显示图像.. 我想要 activity indicator on collectionview 单元格,直到从网络服务器加载图像。我做了所有但无济于事。请指导。我正在使用 gif 图像加载 activity indiactor

 NSURL *urlSTR=nil;
urlSTR = [[NSBundle mainBundle] URLForResource:@"list_loader_Anim@2x" withExtension:@"gif"];

UIImageView* dataimage=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 31, 31)];
dataimage.frame=CGRectMake(0, 0, 31, 31);

dataimage.image = [UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:urlSTR]];

dataimage.center = CGPointMake(cell.frame.size.width/2, cell.frame.size.height/2-70);

最佳答案

看看 SDWebImage:

https://github.com/rs/SDWebImage

它为您提供了异步下载图像的好方法。

关于ios - 我希望 collectionview 单元格上有事件指示器,直到从网络服务器加载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21480320/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com