转自:http://blog.csdn.net/trandy/article/details/6626281

  1. -(UIImageView *) makeRotation:(UIImageView *)image speedX:(float)X speedY:(float)Y  
  2. {  
  3.       
  4. //    头文件中需要定义 PI  
  5. //    #define PI 3.14159265358979323846264338327950288  
  6.       
  7.     if (Y<0) {  
  8.         image.transform = CGAffineTransformMakeRotation(atan(X/(-Y)));  
  9.     }else if(Y>0){  
  10.         image.transform = CGAffineTransformMakeRotation(atanf(X/(-Y))-PI);   
  11.     }  
  12.     return image;  

相关文章:

  • 2022-12-23
  • 2021-06-12
  • 2022-02-13
  • 2021-05-20
  • 2022-12-23
  • 2021-12-06
  • 2021-07-22
  • 2021-07-21
猜你喜欢
  • 2022-12-23
  • 2023-03-03
  • 2021-11-30
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案