13

Is there a way to animate a change in the font size of some text. I was thinking to call drawRect from a subclass of UIView and draw the text at different sizes.

3

2 Answers 2

14

You can animate the transform on any UIView including labels.

[UIView beginAnimations:nil context:nil];
label.transform = CGAffineTransformMakeScale(1.5,1.5);
[UIView commitAnimations];

That will scale the text up to 150%. It may become blocky if you make it too big.

1
  • Beautiful. Pair this with a drop shadow and it looks like the text is really jumping out at you. It's a neat effect. Thanks for the code skorulis.
    – zakdances
    Mar 29, 2013 at 20:51
-3

Have you tried this?

[UIView beginAnimations:nil context:self.view];
[UIView setAnimationDuration:0.5];
label.font = [UIFont font...]; //try setting the font and the size you want
[UIView commitAnimations];
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.