zoukankan      html  css  js  c++  java
  • 视图旋转方式 不及格的程序员

    #define DEGREES_TO_RADIANS(d) (d * M_PI / 180)


    /* [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.35]; self.rotaImageView.layer.transform = CATransform3DRotate(self.rotaImageView.layer.transform, 3*M_PI, 0, 0, 1); [UIView commitAnimations]; */ CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; rotationAnimation.fromValue = [NSNumber numberWithFloat:(DEGREES_TO_RADIANS(180*9))]; rotationAnimation.toValue = [NSNumber numberWithFloat:(DEGREES_TO_RADIANS(0))]; rotationAnimation.fillMode = kCAFillModeForwards; rotationAnimation.removedOnCompletion = NO; rotationAnimation.duration = 0.95f; rotationAnimation.autoreverses = NO; // Very convenient CA feature for an animation like this rotationAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; [self.rotaImageView.layer addAnimation:rotationAnimation forKey:@"rotaAnimation"];
  • 相关阅读:
    JS 可选链操作符?. 空值合并运算符?? 详解,更精简的安全取值与默认值设置小技巧
    手写一个 Promise
    Leetcode 403 青蛙过河 DP
    Leeetcode 221 最大正方形 DP
    Leetcode 139 单词拆分
    Unity周记: 2021.07.26-08.15
    Unity周记: 2021.07.19-07.25
    Unity周记: 2020.07.12-07.18
    Unity周记: 2020.07.05-07.11
    线性规划
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/2699568.html
Copyright © 2011-2022 走看看