Tuesday, December 3, 2013

# # # Why UIView animation end of the function to be called twice? ?

 [UIView beginAnimations: @ "fadeOut" context: nil]; 
[UIView setAnimationDuration: 5.0];
[UIView setAnimationDelegate: self];
[UIView setAnimationDidStopSelector: @ selector (animationStopped)];
self.alpha = 0.0;
[UIView commitAnimations];


animationStopped the outset to be called, and then five seconds later was called once? ?
Reply:
You set up a commission on the stop manually add a commissioned, [UIView setAnimationDidStopSelector: @ selector (animationStopped)]; phrase not. Look for the animation to stop the commission.

Or do not sentence [UIView setAnimationDelegate: self];
Reply:
cited a floor reply:
you do not bother to manually set up a commission to add a commissioned, [UIView setAnimationDidStopSelector: @ selector (animationStopped)]; sentence Do not. Look for the animation to stop the commission.

Or do not sentence [UIView setAnimationDelegate: self];

Remove [UIView setAnimationDelegate: self] after the function animationStopped not called, nor
Reply:
Then you put [UIView setAnimationDidStopSelector: @ selector (animationStopped)]; phrase not.

- (Void) animationDidStop: (NSString *) animationID finished: (NSNumber *) finished context: (void *) context; implement this method.
Reply:
reference to the third floor of the reply:
that you put [UIView setAnimationDidStopSelector: @ selector (animationStopped)]; phrase not.

- (Void) animationDidStop: (NSString *) animationID finished: (NSNumber *) finished context: (void *) context; implement this method.

Try, the same is being called twice?
Reply:
That is, the system determines the call twice, not to have a finished arguments what, I think two calls this parameter should be different. You judge it according to the parameters finished
Reply:
references, 5th Floor reply:
that is determined by the system called twice, and not have a finished arguments what, I think two calls this parameter should be different . You judge it according to the parameters finished

Two parameters are a
Reply:
. . . . . . . . . . . There is such a thing? You use animateWithDuration: animations: completion: this bar. Carefully use
[UIView animateWithDuration: 0.2
animations: ^ {view.alpha = 0.0;}
completion: ^ (BOOL finished) {[view removeFromSuperview];}];
Reply:
reference to the 7th floor of replies:
. . . . . . . . . . . There is such a thing? You use animateWithDuration: animations: completion: this bar. Carefully use
[UIView animateWithDuration: 0.2
animations: ^ {view.alpha = 0.0;}
completion: ^ (BOOL finished) {[view removeFromSuper ......

Have something to do with the original movie. . In a message is being registered more than once led.
Thank you! Knot tie it

No comments:

Post a Comment