I have this code:
successview is my view and it start with alpha 0.00 but when it finish the animation with autoreverse, successview become with alpha 1.00…why?
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2];
[UIView setAnimationRepeatAutoreverses:YES];
[successView setAlpha:1.00];
[UIView commitAnimations];
One approach is to do two different animations: One that progresses towards an alpha value of 1.0 and then another that goes from 1.0 back to 0.
Use the
animateWithDuration:animations:completion:method of theUIViewto accomplish this. You can do the reverse in the completion block.Something along the lines of:
See UIView documentation for more details on animations.