• 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) {
    
        }];
    
    }
  • 相关阅读:
    A
    N
    M
    L
    K
    J
    sass
    通过ps给透明通道的图片添加灰度(适用于需要兼容IE7,效果很好)
    CSS十一问——好奇心+刨根问底=CSSer
    清除浮动的7种方法
  • 原文地址:https://www.cnblogs.com/WJJ-Dream/p/5780101.html
Copyright © 2020-2023  润新知