PDA

View Full Version : UIView animation flickering




ZeeG
Mar 6, 2009, 09:13 PM
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,

[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];



dejo
Mar 6, 2009, 11:36 PM
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.

ZeeG
Mar 7, 2009, 12:34 AM
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.

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!