zoukankan      html  css  js  c++  java
  • 图片的左右摆动

      UIImage * image = [UIImage imageNamed:@"xqx.jpg"];
        self.imageView.image = image;
        
        CABasicAnimation * shake = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
        shake.fromValue = [NSNumber numberWithFloat:-M_PI/45];//45可以修改,越小,摆动的幅度越大
        shake.toValue   = [NSNumber numberWithFloat:+M_PI/45];
        shake.duration = 0.1;//摆动一次耗时
        shake.autoreverses = YES;
        shake.repeatCount = 5;//摆动次数
        [self.imageView.layer addAnimation:shake forKey:@"shakeAnimation"];
        self.imageView.alpha = 1.0;
  • 相关阅读:
    有关乞讨的人
    雪之国
    Direction
    Qt表格
    单例模式
    工作
    Qt模型model、视图view、代理
    Qt数据库sqlite
    QDateTime
    跨工程传输数据
  • 原文地址:https://www.cnblogs.com/benbenzhu/p/3441680.html
Copyright © 2011-2022 走看看