您的位置:首页 > 移动开发 > IOS开发

使用sdWebImage实现对tableView的cell加载图片淡入淡出效果

2015-01-06 15:36 696 查看
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CommonTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"article_Cell" forIndexPath:indexPath];
ArticleEntity *article = self.articleArray[indexPath.row];
cell.titleLabel.text = article.title;
cell.timeLabel.text = article.date;
[cell.imageV sd_setImageWithURL:[NSURL URLWithString:article.image] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
cell.imageV.alpha = 0.0;
[UIView transitionWithView:cell.imageV
duration:1.0
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
[cell.imageV setImage:image];
cell.imageV.alpha = 1.0;
} completion:NULL];
}];
return cell;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios开发
相关文章推荐