Add activity indicator demo

This commit is contained in:
Olivier Poitrey 2012-11-13 17:17:39 +01:00
parent 0c1dd3c857
commit 0920e7a001
1 changed files with 8 additions and 1 deletions

View File

@ -33,7 +33,14 @@
{
if (self.imageURL)
{
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload];
UIActivityIndicatorView *activityIndicator;
[self.imageView addSubview:activityIndicator = [UIActivityIndicatorView.alloc initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]];
activityIndicator.center = self.imageView.center;
[activityIndicator startAnimating];
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload completed:^(UIImage *image, NSError *error, BOOL fromCache)
{
[activityIndicator removeFromSuperview];
}];
}
}