2011-02-07 59 views
0

我想用动画更改按钮的位置,但是动画按钮必须是可点击的。可点击的按钮,而动画的位置更改 - 如何?

我该怎么做?

我尝试了一些解决方案,但我还没有取得任何成功。

[UIButton beginAnimations:nil context:nil]; 
[UIButton setAnimationDuration:1.0]; 
[UIButton setAnimationBeginsFromCurrentState:YES]; 
mybutton.transform = CGAffineTransformMakeTranslation(-10, 0); 
// I also tried this: 
// mybutton.frame = CGRectMake(300, 209, 57, 34); 
[UIButton commitAnimations]; 

请帮助

很多感谢

回答

0

尝试这种方式,我希望它的工作。

myButton.center = CGPointMake(160,300);