我的問題是我得到圖像加載後的活動指標,但它應該出現在圖像加載之前.i'm使用SDWebImageProgressivedownload代碼,但活動指標加載後圖像顯示。請幫助我lazyLoading CollectionView與活動指標
__block UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:activityStyle];
activityIndicator.center = imageView.center;
activityIndicator.hidesWhenStopped = YES;
[imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]
success:^(UIImage *image) { [activityIndicator removeFromSuperview]; }
failure:^(NSError *error) { [activityIndicator removeFromSuperview]; }];
[imageView addSubview:activityIndicator];
[activityIndicator startAnimating];
一些代碼,說明了什麼? – jalone
@jalone謝謝你的回覆。請檢查我更新的代碼 –