SDWebView 画像を使用していますが、リモートから画像を取得しているときに、アクティビティ インジケーターをプレースホルダーとして表示したいと考えています。
ここでマレクの答えを試しましたHow to show an activity indicator in SDWebImage、しかしそれは
UIImage *cachedImage = [manager imageWithURL:url];
廃止されました。
このライブラリを使用して、画像の読み込み中にアクティビティ インジケーターを挿入する方法を教えてくれる人はいますか?
編集
Michael Frederick の指摘に従って、私はこのコードになり、すべてが正常に機能しています。
UIActivityIndicatorView *activityIndicator = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
activityIndicator.hidesWhenStopped = YES;
activityIndicator.hidden = NO;
[activityIndicator startAnimating];
activityIndicator.center = CGPointMake(self.tipImage.frame.size.width /2, self.tipImage.frame.size.height/2);
[imageView setImageWithURL:[NSURL URLWithString:imageString]
placeholderImage:nil options:SDWebImageProgressiveDownload
success:^(UIImage *image) { [activityIndicator stopAnimating];[activityIndicator removeFromSuperview]; }
failure:^(NSError *error) { [activityIndicator stopAnimating];[activityIndicator removeFromSuperview]; }];
[imageView addSubview:activityIndicator];