Skip to content

Commit

Permalink
微调图片滚动加载代码
Browse files Browse the repository at this point in the history
  • Loading branch information
wujunyang committed Mar 31, 2017
1 parent 613dc0d commit 67a12c3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 150;
return 80;
}

#pragma mark 自定义代码
Expand Down Expand Up @@ -109,7 +109,7 @@ - (void)setupCell:(UITableViewCell *)cell withIndexPath:(NSIndexPath *)indexPath
if (shouldLoadImage) {
NSLog(@"我这时加载的图片是%ld",indexPath.row);

[cell.imageView sd_setImageWithURL:targetURL placeholderImage:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
[cell.imageView sd_setImageWithURL:targetURL placeholderImage:[UIImage imageNamed:@"public_empty_loading"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
if (!error && [imageURL isEqual:targetURL]) {
[UIView animateWithDuration:0.25 animations:^{
cell.imageView.alpha = 1.0;
Expand Down

0 comments on commit 67a12c3

Please sign in to comment.