Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>the best way is to add the activityIndicator in all "setImage" functions in UIImageView+WebCache.m, after that you remove it in "webImageManager:r didFinishWithImage:" , i test it in device and it work smoothly, her's an example : </p> <pre><code> - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyleWhiteLarge)]; [activity startAnimating]; [activity setCenter:self.center]; [self addSubview:activity]; [activity release]; SDWebImageManager *manager = [SDWebImageManager sharedManager]; UIImage *cachedImage = [manager imageWithURL:url]; if (cachedImage) { // the image is cached -&gt; remove activityIndicator from view for (UIView *v in [self subviews]) { if ([v isKindOfClass:[UIActivityIndicatorView class]]) { [activity removeFromSuperview]; } } } [self setImageWithURL:url placeholderImage:placeholder options:0]; } </code></pre> <p>and you remove it with a fade animation ;) :</p> <pre><code> - (void)webImageManager:(SDWebImageManager *)imageManager didFinishWithImage:(UIImage *)image { for (UIView *v in [self subviews]) { if ([v isKindOfClass:[UIActivityIndicatorView class]]) { // NSLog(@"-didFinishWithImage-"); [((UIActivityIndicatorView*)v) stopAnimating]; [v removeFromSuperview]; } } [UIView beginAnimations:@"fadeAnimation" context:NULL]; [UIView setAnimationDuration:0.9]; self.alpha = 0; self.image = image; self.alpha=1; //[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self cache:YES]; [UIView commitAnimations]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload