主要使用了tableView的代理方法

行将要显示的时候

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath

代码:

   cell.contentView.alpha = 0.3;
    CGAffineTransform transformScale = CGAffineTransformMakeScale(0.3,0.8); //缩放
    CGAffineTransform transformTranslate = CGAffineTransformMakeTranslation(0.5, 0.6);//改变位置
    
    cell.contentView.transform = CGAffineTransformConcat(transformScale, transformTranslate);
    [tableView bringSubviewToFront:cell.contentView];
    [UIView animateWithDuration:.4f
                          delay:0.05
                        options:UIViewAnimationOptionAllowUserInteraction
                     animations:^{
                         
                         cell.contentView.alpha = 1;
                         
                         //清空 transform
                         
                         cell.contentView.transform = CGAffineTransformIdentity;
                     } completion:nil];

效果图:

UITableView滑动动画+FPSLabel

github连接:

https://github.com/WuJiForFantasy/CellAnimation

 

相关文章:

  • 2021-11-28
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
相关资源
相似解决方案