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"];
  • 相关阅读:
    GPU 版 TensorFlow failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
    Python -- 值转换为字符串的两种机制
    Python
    vim中注释多行python代码
    HTTP协议状态码详解(HTTP Status Code)
    关于Python报错:SyntaxError: Non-ASCII character 'xe5' in file的解决方法
    Linux如何查看进程、杀死进程、启动进程等常用命令
    vim 如何设置显示行号和缩进
    一、报错
    二、极光推送
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/2699568.html
Copyright © 2011-2022 走看看