【发布时间】:2011-09-27 11:37:28
【问题描述】:
大家.. 如何设置按钮点击动画?
我有两个按钮,都有不同的框架..
First CGRectMake (10 , 10 , 100 , 80 ); It has Black Image,
Second CGRectMake (200, 10 , 210 , 80 ); It has White Image,
当我点击其中的第一个按钮时,它应该是动画从一个帧移动到另一个帧..
只看到第一个按钮的黑色图像移动到第二个按钮位置..就像按钮的图像更改..
点击按钮后框架没有改变...应该保持为第一和第二..
我试过了,但不准确
buttonFirst.frame = buttonSecond.frame;
buttonFirst.center = buttonSecond.center;
buttonFirst.transform = CGAffineTransformMakeTranslation( buttonSecond.frame.origin.x - buttonFirst.frame.origin.x , buttonSecond.frame.origin.y - buttonFirst.frame.origin.y);
如何制作动画?
编辑:
我需要将一个跳棋从一个 CGRect 移动到另一个 CGRect.. 所以,它想像移动跳棋一样显示,但我不想更改 CGRect,只有按钮图像看起来像这样...
请告诉我.. 谢谢...
【问题讨论】:
标签: iphone objective-c animation core-animation