views:

830

answers:

2

I want to create transition animation within a UIView (not from one UIView to another).

I have one UIView that has two UITextView fields with some text in them that comes from a database record. There are next/back buttons on the screen also. When the user pressed the next button, the next record contents are shows.

When this transition is taking place from one record to the next, I want to show some kind of animation of the entire view like CurlUp, FadeIn etc. Is this possible? Is so, can you provide some sample code?

+2  A: 

You can animate any view (root view or subview) just by changing supported properties within a UIView beginAnimations/commitAnimations block.

That said I don't know whether a text is a supported property. Instead you may have to "fake" the text change by having overlaid UITextView's with one fading out and the next fading in.

So yes, you can definitely do such an animation for when your text changes but you may have to be creative about it.

Andrew Grant
I was able to do this on the UITextView by changing the alpha property.
A: 

It is, you'll want to check out CoreAnimation, and the use of the animator: method call.

There's a pretty cool example/tutorial in Apple's programming guide:

Core Animation Programming Guide

craig