滚动表格视图后,动画图像消失了

时间:2019-12-13 07:30:33

标签: ios sdwebimage

我正在使用一个具有一个表视图的iOS应用程序。表格视图单元格有一个按钮,我使用SDWebimage处理图像。滚动表视图后,按钮上的动画图像消失了。

iOS版本:12.2

SDWebImage版本:5.4.4

xcode版本:11.3

演示项目链接:https://github.com/relaxfinger/SDWebImageDemo.git

屏幕截图链接:https://drive.google.com/file/d/1cEGYsnFdpOh4xgfML5dk59S8iiVlhmfC/view?usp=sharing

代码:

- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TableViewCell" forIndexPath:indexPath];
    if (indexPath.row > 0) {
        [cell.button setImage:[UIImage imageNamed:@"ic_placehold_font"] forState:UIControlStateNormal];
    } else {
        [cell.button sd_setImageWithURL:[NSURL URLWithString:@"http://images.ypcang.com/1575890250112.png"]
                forState:UIControlStateNormal
        placeholderImage:[UIImage imageNamed:@"ic_placehold_font"]];
    }

    return cell;
}

0 个答案:

没有答案
相关问题