iPad: Animate UILabels color changing

后端 未结 7 406
礼貌的吻别
礼貌的吻别 2020-12-04 20:37

I have a label which pops up displaying points in my application. I am using the following code to make the label get larger in scale, then smaller. I would also like to ani

7条回答
  •  无人及你
    2020-12-04 20:53

    The reason that textColor is not animatable is that UILabel uses a regular CALayer instead of a CATextLayer.

    To make textColor animatable (as well as text, font, etc.) we can subclass UILabel and make it use a CATextLayer.

    This is quite a lot of work, but luckily I already did it :-)

    You can find a complete explanation + a drop-in open source replacement for UILabel in this article

提交回复
热议问题