views:

200

answers:

2

For some reason, when I try to animate textColor, it won't work. The textColor just suddenly changes from A to B. Is it possible to animate it, from lets say red to black?

+2  A: 

The textColour property is not specified as being animateable in the docs, so I don't think you can do it with a simple UIView animations block...

This could probably be done pretty crudely with an NSTimer firing every couple of milliseconds, each time setting the colour gradually from one to the other.

I say this is crude because it would require an array or some other container of preset colour values going from the start colour to the finish colour, and I'm sure there's a way you could do this using core animation or something, I just don't know what it is.

Jasarien
or: a function that throws out an array with RGB values between A and B and a given percentage. Don't know anything about color algorithms though.
dontWatchMyProfile
+4  A: 

You could try creating another instance of the UILabel or whatever it is that has the textColor, and then apply the animation between those two instances (the with the old textColor and the one with the new textColor).

benasher44