0

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?

Thanks

2 Answers 2

1

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"]; 
Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

Animating the alpha is not obvious to users

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.