How to control overlapping Alpha fades on iPhone...

Posted by ReduxDJ on Stack Overflow See other posts from Stack Overflow or by ReduxDJ
Published on 2010-06-15T21:12:48Z Indexed on 2010/06/15 22:42 UTC
Read the original article Hit count: 233

Filed under:
|

I have two animation methods, basically the just repeat... How do I prevent them from overlapping and flickering, is there a convenient way to do this?

Thanks,

-(void) doPowerChangeAnimUp
{
    powerIconChange .alpha    = 0;
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDidStopSelector:@selector(animationDidStop:)];
    [UIView setAnimationDelegate:self] ;
    [UIView setAnimationDuration:2];
    [powerIconChange  setAlpha:1];
    [UIView commitAnimations];
}

-(void)animationDidStop:(NSString *)animationID 
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDelegate:self] ;
    [UIView setAnimationDidStopSelector:@selector(doPowerChangeAnimUp)];
    [UIView setAnimationDuration:2];
    [powerIconChange  setAlpha:0];
    [UIView commitAnimations];
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiview