Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animate a change in UIFont size

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.

like image 298
prostock Avatar asked May 26 '11 07:05

prostock


People also ask

How do I change the text size on my iPhone for a specific app?

Go to “Settings” > “Control Center,” then find “Text Size” and tap the green plus sign. “Text Size” will now be part of the included controls. Once that's done, it's simple to tweak the text size for each app: Open the app that you want to configure.

How do I change the font size on my IPAD notes?

There are no print size options for iPadOS. You'd need to increase the font size of the document prior to printing. To do that, select all text and use the icon shown in the image on the keyboard to adjust the font size.


1 Answers

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.

like image 154
skorulis Avatar answered Oct 16 '22 13:10

skorulis