3

Possible Duplicate:
How to animate the background color of a UILabel?

I'm pretty new to animating things on iOS and have a basic question.

I have a UILabel that I want to briefly change the color of. Basically, inside of cellForRowAtIndexPath: I am reloading my cell's every 15 seconds or so. If a certain cell meet's a requirement, I want to briefly change the label's color and animate it to fade off back to it's original color.

Pop on, fade out.

Any tips would be amazing. Thanks guys.

Community
  • 1
  • 1
crewshin
  • 765
  • 9
  • 22

1 Answers1

3

This isn't the brightest solution, but it might get you to what you need: Create an identical, new UILabel with the same frame, font, etc... but with a different color. Use the animatable "alpha" property to fade your old color out and it will seem as if the underlaying label's color is being transitioned in.

Stavash
  • 14,244
  • 5
  • 52
  • 80
  • Actually, this is a pretty good solution. Since we're not redrawing the label - just changing the alpha - it's going to be *fast* (much faster than a re-implementation of UILabel that actually redraws the text in a new colour). – Nuoji May 15 '13 at 22:24