大家.. 如何设置按钮点击动画?UIButton上的动画点击iPhone
我有两个按钮,两者具有不同的帧..
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);
如何制作动画呢?
EDITTING:
我需要从一个的CGRect移动一个棋子到另一种的CGRect。所以,它要显示像移动棋子,但我不想改变的CGRect,只有按钮图像看起来像这样.. 。
请告诉我.. 谢谢...
是,还..这里是一个代码..的UIImageView * ImageView的= [[ALLOC的UIImageView] INIT]; [imageView setFrame:button.frame]; [imageView setImage:buttonS.currentBackgroundImage]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:2.0]; [imageView setFrame:buttonS.frame]; [UIView commitAnimations]; [imageView removeFromSuperview];但没有工作.. –