3
好吧,这是要让我疯了 - 任何帮助将不胜感激。我有两个图像是计时器应用程序的一部分。一个是针/手,另一个是一个小针座,其风格看起来像针座。我正在使用CGAffineTransformMakeRotation旋转针头,底座保持静止。问题在于:针的旋转像是1-2px的“漂移”,使其看起来像是相对于底座偏离中心。我已经在PS中广泛使用了基础和针形图像,并且都是死点像素明智的 - 严重。我的方法来旋转手:徘徊CGAffineTransformMakeRotation
-(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];
}
}
为什么不使用CoreAnimation或UIView动画块? – kennytm 2010-04-29 05:01:02
我可以看到这是一个选项,但即使我切换到使用CA,我仍然想知道CGAffineTransform/rotate发生了什么。是否有关于它的一些原因导致了这一点?我认为,这是最简单的一种图像旋转 - 基本上只是旋转它的轴。 – Joe 2010-04-29 11:30:05