徘徊CGAffineTransformMakeRotation

时间:2010-04-29 04:05:41

标签: objective-c

好的,这将使我疯狂 - 任何帮助将不胜感激。我有两个图像,它们是计时器应用程序的一部分。一个是针/手,另一个是小轮毂,其外观看起来像针座。我正在使用CGAffineTransformMakeRotation旋转针头,底座保持静止。问题是:针的旋转有一个1-2像素的“漂移”,这使得它看起来像是相对于基座偏离中心。我已经广泛地在PS中对基础和针图像进行了研究,并且两者都是死中心像素 - 严重。我旋转手的方法:

-(IBAction) rotateSteamArrow{

 CGAffineTransform rotate = CGAffineTransformMakeRotation( degreesSteam / 180.0 *   3.14159265);
 degreesSteam = degreesSteam + 1.5;
  if (degreesSteam <= 180) {
  [steamNeedle setTransform:rotate];
  }
  else {
   [self handleSteamTimer];
   [self toggleButton:(id)timerButton];
   [self switchSound];
  }


 }

1 个答案:

答案 0 :(得分:0)

尝试使用视图锚点,直到它不再摇摆。

相关问题