Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started creating custom view transitions

I'm looking for tutorials on creating custom view transitions.

In particular, transitions that involve elements other than just the UIViews being affected, such as playing an animation over the transition as it is happening or modifying a screenshot of the UIView being transitioned out.

I don't mean implementing the basic set of transitions (slide, fade, etc) for which there's plenty of examples on Apple's site. I'm talking about adding video/sound/additional animation while wrapping it all in a reusable transition.

I'm vaguely familiar with some of the underlying toolkits (core-animation and quartz) but I'm looking for a no-prior-experience tutorial on the subject.

like image 447
Sam Avatar asked Jun 29 '09 21:06

Sam


People also ask

What is a custom transition?

A custom transition enables you to create an animation that is not available from any of the built-in transition classes. For example, you can define a custom transition that turns the foreground color of text and input fields to gray to indicate that the fields are disabled in the new screen.


2 Answers

I have just put together a transition class to implement your own animation in OpenGL ES.

Feel free to read about it here

like image 197
epatel Avatar answered Oct 13 '22 00:10

epatel


CoreAnimation animations work by recording differences in a very specific subset of UIView properties. They do not respond to any user-defined properties, and simply don't do more advanced transitions than you've already seen in the demos. You could take a screenshot of your current view, save it in memory as a texture, hide the old view and simultaneously show an OpenGL view. Then using the screenshot texture and various mesh animations, you could render your custom transition (including alpha blending around the crumpled/folded edges), then dispose of the OpenGL view to fully reveal the target view. Seems like a fun project, and you'd be in rare company to accomplish it.

like image 27
jd. Avatar answered Oct 13 '22 01:10

jd.