有时候因为项目的需要,给tableView添加一些动画:

cell.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1);
 [UIView animateWithDuration:0.25 animations:^{
    cell.layer.transform = CATransform3DMakeScale(1, 1, 1);
}];

 

或者 

- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row % 2 != 0) {
    cell.transform = CGAffineTransformTranslate(cell.transform, ScreenWidth/2, 0);

    }else{
     cell.transform = CGAffineTransformTranslate(cell.transform, -ScreenWidth/2, 0);
}
cell.alpha = 0.0;

    [UIView animateWithDuration:0.7 animations:^{

        cell.transform = CGAffineTransformIdentity;

        cell.alpha = 1.0;

    } completion:^(BOOL finished) {

    }];

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2022-01-23
  • 2021-06-22
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2021-04-05
  • 2021-04-29
  • 2021-11-16
相关资源
相似解决方案