UIView animation flickering

Discussion in 'iOS Programming' started by ZeeG, Mar 6, 2009.

  1. ZeeG macrumors member

    May 24, 2005
    I want to fade out a UIImage in my application, and it works fine on simulator, but I'm getting weird flickering when running on iPhone.
    Following is the code I used.
    Please help me resolving this problem.

     [messageLabelBadge setImage:badge];
         [messageLabelBadge setAlpha:100.0];
         [messageLabelBackground setAlpha:100.0];
         messageLabel.text = message;
         [messageLabel setAlpha:100.0];
         [UIView beginAnimations :nilcontext:NULL];
         [UIView setAnimationDuration:3];
         [messageLabel setAlpha:0];
         [messageLabelBackground setAlpha:0];
         [messageLabelBadge setAlpha:0];
         [UIView commitAnimations];
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Just thought I'd mention that alpha values are restricted to the range from 0.0 to 1.0. Don't know if that's the cause though.
  3. ZeeG thread starter macrumors member

    May 24, 2005
    Thank you! you saved me :)
    I don't know why I thought the range is 0 to 100. :(
    I read API but probably wasn't careful about the value..
    Thanks a lot!

Share This Page