简体   繁体   English

如何通过水效果切换内容视图?

[英]How can I switch Content Views with an water-effect transition?

In the Photos app, there is a nice water drop effect used for transition. 在“照片”应用中,有一个很好的水滴效果可用于过渡。 I had seen an app a while ago that used this same water effect transition for it's content views. 不久前我见过一个应用,该应用的内容视图使用了相同的水效果转换。

Unfortunately, this transition type is not listed in the UIViewAnimationTransition documentation. 不幸的是,此过渡类型未在UIViewAnimationTransition文档中列出。 But since this third party app used it (I don't remember it's name), I guess that there is a way of using it. 但是由于该第三方应用程序使用了它(我不记得它的名字了),所以我想有一种使用它的方法。

Does anyone know? 有人知道吗?

It is not part of the published SDK. 它不是已发布的SDK的一部分。 If you want to sell your app in the app store, you need to implement this yourself. 如果要在应用商店中出售应用,则需要自己实施。

I think it's just a hidden CATransition type: 我认为这只是一个隐藏的CATransition类型:

CATransition *transition = [CATransition animation];
transition.type = @"rippleEffect";
transition.duration = 5.0f;
transition.timingFunction = UIViewAnimationCurveEaseInOut;
[self.layer addAnimation:transition forKey:@"transitionViewAnimation"];

(Note: I haven't tried this for rippleEffect but I have used suckEffect and spewEffect similarly) (注意:我没有为rippleEffect尝试过此操作,但我类似地使用了suckEffectspewEffect

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM