views:

440

answers:

1

I have a Cocoa app I'm writing that has an ImageView with a TextView as a subview sitting on top of the ImageView. I have two functions, one that updates the image in the ImageView and one that updates the text in the TextView. Both of those functions work properly, but I would like the new text to fade in or cross fade from the old text. In the same way I would like to cross fade in the new image.

I've tried [[self animator] setImage:image] for the ImageView, but that doesn't seem to do anything.

Thank you for your help.

+1  A: 

I'm not sure this is the best option, since it means doubling the memory usage for a couple of seconds, but you COULD (meaning, not necessarily SHOULD) create a new ImageView and a new TextView, each with opacity zero, and identical to the originals (with the new text and image of course), and then fade out the old ones and fade in the new ones. Once the animation is complete, release the originals

I had the same thought. I gave it a try and it seems to work pretty well. Any idea how to control the transition/effect duration using the animator proxy? i.e. doing it like [[self animator] setAlphaValue:0.0];
Austin