zoukankan      html  css  js  c++  java
  • ios开发——实用技术篇&三维旋转动画

    实现三位旋转动画的方法有很多种,这里介绍三种

    一:UIView

    复制代码
    1     [UIView animateWithDuration:1.0 animations:^{
    2         self.iconView.layer.transform = CATransform3DMakeRotation(M_PI_2, 0, 1, 0);
    3     } completion:^(BOOL finished) {
    4         self.iconView.image = [UIImage imageNamed:@"user_defaultgift"];
    5        
    6         [UIView animateWithDuration:1.0 animations:^{
    7             self.iconView.layer.transform = CATransform3DMakeRotation(M_PI, 0, 1, 0);
    8         }];
    9     }];
    复制代码

    二:CATransition自定义

    1     CATransition
    2     CATransition *anim = [CATransition animation];
    3     anim.duration = 1.0;
    4     anim.type = @"rippleEffect";
    5     [self.iconView.layer addAnimation:anim forKey:nil];

    三:CATransition

    复制代码
     1     
     2     [UIView transitionWithView:self.iconView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
     3         self.iconView.image = [UIImage imageNamed:@"user_defaultgift"];
     4     } completion:^(BOOL finished) {
     5         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
     6             [UIView transitionWithView:self.iconView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromRight animations:^{
     7                 self.iconView.image = [UIImage imageNamed:@"default_avatar"];
     8             } completion:nil];
     9         });
    10     }];
    11 }
    复制代码
  • 相关阅读:
    七种常见的回归分析—转载
    Python模块之 __future__ 转载
    Java 快速排序
    在给定范围内产生指定个数不重复的随机数
    Java 冒泡排序
    jquery文本框效果
    jquery复选框
    struts2下的Ajax
    java线程系列---Runnable和Thread的区别
    System.getProperty("user.dir")
  • 原文地址:https://www.cnblogs.com/yulei126/p/6790370.html
Copyright © 2011-2022 走看看