• iOS-tableViewCell创建时添加一些动画


    有时候因为项目的需要,给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) {
    
        }];
    
    }
  • 相关阅读:
    串口应用
    状态栏颜色
    冒泡排序
    快速排序
    good软件测试博客地址
    软件测试面试题
    股票基础知识
    软件测试基本知识
    软件测试流程
    mycat实现分库分表(二)
  • 原文地址:https://www.cnblogs.com/WJJ-Dream/p/5780101.html
Copyright © 2020-2023  润新知