[英]iOS image view: how can I implement this?
如图中的照片所示,图像视图中的占位符与在后台下载图像的大小相同,该如何实现呢?
You can use AFNetworking for this. 您可以为此使用AFNetworking 。 It is the best Networking Library available for iOS.
它是适用于iOS的最佳网络库。 Even best apps like Facebook iOS app is using AFNetworking.
甚至最好的应用程序(如Facebook iOS应用程序)都在使用AFNetworking。
#import "UIImageview+AFNetworking.h"
After importing just use like this 导入后就像这样使用
[imageView setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://someurl.com"]
placeholderImage:[UIImage imageNamed:@"loading.png"]
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
imageView.image = image;
} failure:nil];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.