Take the 2-minute tour ×

I have placed a Cocoa Touch UILabel, which displays numbers.

What I want is to animate the text in UILabel when number changed. So that the user can be easier to notice the number is changing.

The animation can be very simple, for example, when the text is changed, it first zooms to a bigger size, and then zooms back to normal size.

It seems I can only animate the font size.

any suggestions?


share|improve this question

2 Answers 2

How about fade out the previous uilabel, change it, then fade it back in (using the alpha property)?

share|improve this answer
Animating the alpha is not obvious to users –  user325320 Sep 23 '11 at 11:57

Why dont you do this scale increase and finally decrease back to normal on the UILabel itself?

Create scale animation in UILabel's CALayer -

CAKeyframeAnimation *scaleAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
NSArray *scaleValues                = [NSArray arrayWithObjects:
                                         [NSValue valueWithCATransform3D:CATransform3DScale(v.layer.transform, 1, 1, 1)],
                                         [NSValue valueWithCATransform3D:CATransform3DScale(v.layer.transform, 1.1, 1.1, 1)],
                                         [NSValue valueWithCATransform3D:CATransform3DScale(v.layer.transform, 1, 1, 1)], nil];
[scaleAnimation setValues:scaleValues];
scaleAnimation.fillMode             = kCAFillModeForwards;
scaleAnimation.removedOnCompletion  = NO;
[yourUILabel.layer addAnimation:scaleAnimation forKey:@"scale"];
share|improve this answer

Your Answer


