views:

34

answers:

1

i'm setting new text value to a uilabel. Currently, the new text appears just fine. However, I'd like to add some animation to how the new text appears. I'm wondering what i can do to animate the appearance of the new text.

+1  A: 

Here is the code to make this work.

[UIView beginAnimations:@"animateText" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:1.0f];
[self.lbl setAlpha:0];
[self.lbl setText:@"New Text";
[self.lbl setAlpha:1];
[UIView commitAnimations];
Joo Park