2012-11-20 26 views

回答

0

活动指标是一个视图,我想你的占位符图像只是一个图像。

如果sdwebimage不给您添加视图而不是占位符图像的可能性,最好的方法是使用animated image of an activity indicator

1

你可以这样来做:

添加一个指标到您的视图,将其放置在您的ImageView

UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 
    [indicator startAnimating]; 
    [indicator setCenter:self.imageView.center]; 
    [self.contentView addSubview:indicator]; 

的中心距块中的更迭方法上海华取下指示器。

[_imageView setImageWithURL:[NSURL URLWithString:anURL] 
         success:^(UIImage *image) { 
          [indicator removeFromSuperview]; 
         } 
         failure:^(NSError *error) { 

         }]; 
} 

当然你可以做一个很好的子类此

0

请到通过this链接了解下载文件异步

+0

本教程不包括有关活动的指标的任何信息 –