由于它们都是单独的动画,因此您也可以尝试使用 AnimationDidStopSelector ,一旦动画完成就会被调用;)
哦,顺便说一句,在您的 CGRectMake 中,您再次使用 x 坐标作为 y 坐标,这可能是位置不准确的原因^^
所以是这样的:
- (void)yourFunction {
[UIView beginAnimations:nil context:indexPath];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(functionEnded:finished:context:)];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:mybutton cache:YES];
[UIView commitAnimations];
}
- (void)functionEnded:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
[UIView beginAnimations:nil context:indexPath];
[UIView setAnimationDuration:1.3];
[mybutton setFrame:CGRectMake(mybutton.frame.origin.x, mybutton.frame.origin.y, 200, 200)];
[UIView commitAnimations];
}