3

以下のコードで、viewDidAppear: で無限に繰り返す uianimation を提供しています。

[UIView beginAnimations:@"theAnimation" context:NULL];
[UIView setAnimationDuration:2];

[UIView setAnimationRepeatCount:FLT_MAX];
[UIView setAnimationRepeatAutoreverses:YES];
[startButton setAlpha:.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];


[UIView commitAnimations];
[super viewDidAppear:YES];

しかし、pushViewController を使用してページに移動し、同じビュー コントローラーに戻ると、viewDidAppear が呼び出されますが、アニメーションが機能しません。presentViewController.Canを使用すると正常に動作します。誰か助けてください。ありがとう

4

1 に答える 1

2

[super viewDidAppear:YES];アニメーションコードの前に呼び出してみてください。

于 2013-01-23T09:29:34.093 に答える