UIView“suck”动画 [英] UIView "suck" animation

查看:107
本文介绍了UIView“suck”动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用UIView的吸吮转换(视图是吸吮到一个点):

I'd like to use the UIView "sucking" transition (view is "sucked" into a point) referenced here:

http://iphonedevwiki.net/index.php/UIViewAnimationState#Using_suckEffect

然而,上面的方法使用私有API,这使得它旁边对于App Store应用程序是无用的。如何在不依赖私有API的情况下重现类似的效果?

The method above, however, uses private APIs, which makes it next to useless for an App Store app. How can I recreate a similar effect without relying on private APIs? I'm guessing the answer has to do with OpenGL, although I have zero experience there.

推荐答案

只要苹果没有' t公开记录的效果,你想避免被拒绝使用私人API的风险,你必须自己滚动。

As long as Apple doesn't publicly document the effect, and you want to avoid the risk of being rejected for using private API's you'll have to roll your own.

开始工作的建议是使用OpenGL ES着色器。

A suggestion to start working on this would be using OpenGL ES shaders.

以下博文包含一个演示Quartz Composer补丁,用于创建如OS X和iOS中所示的Genie效果:
http://www.aderstedtsoftware.com/users/erik/weblog/c7cb9/

The following blog post includes a demo Quartz Composer patch to create the Genie effect as seen in OS X and iOS: http://www.aderstedtsoftware.com/users/erik/weblog/c7cb9/

OpenGL ES着色器的一个好的开始是使用QuartzComposer文件中的Genie Filter中的代码。该代码几乎可以复制到OpenGL的着色器。最多的工作可能是在您的应用程序中集成OpenGL:将正确的视图渲染为OpenGL纹理,并在您的应用程序上覆盖OpenGL,以便根据您的着色器执行动画。

A good start for your OpenGL ES shader would be to use the code in the Genie Filter in this QuartzComposer file. The code can almost be copied to a shader for OpenGL as is. The most work would probably be integrating OpenGL in your application: rendering the right view to a OpenGL texture and overlaying OpenGL over your application to perform the animation based on your shader.

这篇关于UIView“suck”动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆