仿 QQ 消息 显示动画

  • (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
    RTHomeTableViewCell *displayCell = (RTHomeTableViewCell *)cell;

    if (!displayCell.model.isAnimated) {
    //效果1
    // cell.transform = CGAffineTransformMakeScale(0.5, 0.5);//CGAffineTransformScale(cell.transform, 0.5, 0.5);
    //效果2
    // cell.transform = CGAffineTransformMakeTranslation(0, cell.height);
    //效果3
    cell.transform = CGAffineTransformMakeTranslation(-JKScreenW * 0.5, 0);

      cell.alpha = 0;
      [UIView animateWithDuration:0.5 animations:^{
          cell.transform = CGAffineTransformIdentity;
          cell.layer.transform = CATransform3DIdentity;
          cell.alpha = 1.0;
          displayCell.model.isAnimated = YES;
          
      } completion:^(BOOL finished) {
          
      }];
    

    }
    }

推荐阅读更多精彩内容