zoukankan      html  css  js  c++  java
  • 360旋转动画

    -(void)rote360Image{

        CABasicAnimation *animation =[CABasicAnimation animationWithKeyPath:@"transform" ];

        animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];

        //圍繞z軸旋轉,垂直螢幕

        animation.toValue =[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 0, 0, 1.0)];

        animation.duration = 3;

        //旋轉效果累計,先轉180度,接著再旋轉180度,從而實現360度旋轉

        animation.cumulative = YES;

        animation.repeatCount = 2;

        

        //在圖片邊緣新增一個像素的透明區域,去圖片鋸齒

        CGRect imageRrect = CGRectMake(0, 0,self.splashImageView.frame.size.width, self.splashImageView.frame.size.height);

        UIGraphicsBeginImageContext(imageRrect.size);

        [self.splashImageView.image drawInRect:CGRectMake(1,1,self.splashImageView.frame.size.width-2,self.splashImageView.frame.size.height-2)];

        self.splashImageView.image = UIGraphicsGetImageFromCurrentImageContext();

        UIGraphicsEndImageContext();

        

        [self.splashImageView.layer addAnimation:animation forKey:nil];

    }

  • 相关阅读:
    多线程
    ERP概念介绍
    Servlet生命周期
    springmvc工作流程
    spring事务管理的接口
    解决主从备份Slave_SQL_Running:No
    实现Mysql主从备份
    springboot集成mybatis进行开发
    SpringBoot 入门第一章
    Hibernate 关联关系映射
  • 原文地址:https://www.cnblogs.com/wangzhendong/p/4033482.html
Copyright © 2011-2022 走看看