• [转载]CABasicAnimation animationWithKeyPath 一些规定的值


    CABasicAnimation animationWithKeyPath Types

    When using the ‘CABasicAnimation’ from the QuartzCore Framework in Objective-C, you have to specify an animationWithKeyPath.  This is a long string and is not easily listed in the CABasicAnimation, CAPropertyAnimation, or the CAAnimation class.  I ended up finding a handy chart within the Core Animation Programming guide in Apple’s iPhone OS Reference Library.  Hope this helps save someone time, at least it will for me.

    animationWithKeyPath types


    01.//The following code moves a view up 60 pixels and stops.
    02. 
    03.CABasicAnimation *theAnimation;
    04.theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
    05.theAnimation.delegate = self;
    06.theAnimation.duration = 1;
    07.theAnimation.repeatCount = 0;
    08.theAnimation.removedOnCompletion = FALSE;
    09.theAnimation.fillMode = kCAFillModeForwards;
    10.theAnimation.autoreverses = NO;
    11.theAnimation.fromValue = [NSNumber numberWithFloat:0];
    12.theAnimation.toValue = [NSNumber numberWithFloat:-60];
    13. 
    14.[self.view.layer addAnimation:theAnimation forKey:@"animateLayer"];

  • 相关阅读:
    常见Dos命令
    常用快捷键小技巧
    springboot集成JPA返回Json报错 com.fasterxml.jackson.data
    docker安装mysql 8.0.20 版本 超详细教程
    8.24 Java自学
    8.23 Java自学
    8.22 Java自学
    8.21 Java自学
    8.20 Java自学
    8.19 Java自学
  • 原文地址:https://www.cnblogs.com/cnsec/p/11515889.html
Copyright © 2020-2023  润新知