首页 > 移动平台 > 详细

ios之动画效果

时间:2015-11-14 17:46:29      阅读:317      评论:0      收藏:0      [点我收藏+]

1 波纹效果

- (void)makeRipple

{

    CATransition *animation = [CATransition animation];

    animation.duration = 1.0;

    animation.timingFunction = UIViewAnimationCurveEaseInOut;

    animation.type = @"rippleEffect";

    animation.subtype = kCATransitionFromLeft;

    [self.view.window.layer addAnimation:animation forKey:nil];

    

}

 

2 加载tableview上图片显示效果

// cell 出现动画

- (void)tableView:(UITableView *)tableView

    tabelViewCell:(UITableViewCell *)cell

{

    cell.alpha = 0.5;

    CGAffineTransform transformScale = CGAffineTransformMakeScale(0.3,0.8);

    CGAffineTransform transformTranslate = CGAffineTransformMakeTranslation(0.5, 0.6);

    

    cell.transform = CGAffineTransformConcat(transformScale, transformTranslate);

    

    [tableView bringSubviewToFront:cell];

    [UIView animateWithDuration:.4f

                          delay:0

                        options:UIViewAnimationOptionAllowUserInteraction

                     animations:^{

                         

                         cell.alpha = 1;

                         //清空 transform

                         cell.transform = CGAffineTransformIdentity;

                         

                     } completion:nil];

}

 

3 Cell动画效果

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

    

    CATransform3D rotation;

    rotation = CATransform3DMakeRotation( (90.0*M_PI)/180, 0.0, 0.7, 0.4);

    rotation.m34 = 1.0/ -600;

    

    cell.layer.shadowColor = [[UIColor blackColor]CGColor];

    cell.layer.shadowOffset = CGSizeMake(10, 10);

    cell.alpha = 0;

    cell.layer.transform = rotation;

    cell.layer.anchorPoint = CGPointMake(0, 0.5);

    

    

    [UIView beginAnimations:@"rotation" context:NULL];

    [UIView setAnimationDuration:0.8];

    cell.layer.transform = CATransform3DIdentity;

    cell.alpha = 1;

    cell.layer.shadowOffset = CGSizeMake(0, 0);

    [UIView commitAnimations];

}

 

ios之动画效果

原文:http://www.cnblogs.com/xiaochong1234/p/4964563.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!