0
我读过几个主题来移动一个UIButton,并可以触摸按钮时,它的移动。现在我正在使用UIView beginAnimation,但当它移动时,按钮不能被触摸。UIButton移动和触摸
我也读过一些关于NSTimer的内容,但这不是在我的项目中做的最好方法。
有没有别的办法,有人有同样的问题?
这里我举的例子代码..
UIButton *buttonTapObject = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[buttonTapObject addTarget:self action:@selector(tapObjectTapped:) forControlEvents:UIControlEventTouchUpInside];
buttonTapObject.tag = 100;
buttonTapObject.frame = CGRectMake(-80.0, 40.0, 80.0, 80.0);
[UIView beginAnimations:@"example" context:NULL];
[UIView setAnimationDuration:2.0];
// Move to right
buttonTapObject.center = CGPointMake(360.0, 100.0);
[UIView commitAnimations];
是的,我可以触摸其他按钮,不会移动 – Flappy 2010-10-12 14:05:42
后处理动画的一些代码。 – DexterW 2010-10-12 15:30:32