UIView animation flickering

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

  1. ZeeG
    Expand Collapse
    macrumors member

    Joined:
    May 24, 2005
    #1
    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.
    Thanks,

    Code:
     [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
    Expand Collapse
    Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    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
    Expand Collapse
    thread starter macrumors member

    Joined:
    May 24, 2005
    #3
    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