在UIImageView上保留Ripple效果 [英] Preserve Ripple effect over UIImageView

查看:204
本文介绍了在UIImageView上保留Ripple效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的UIImageView上保留Ripple效果。我知道我们可以为图像设置动画效果,但保留。换句话说,我想要一个波纹图像。

I want to preserve Ripple effect on my UIImageView. I know we can animate image for ripple effect , but preserve. In other words I want a rippled image.

我知道我们可以使用

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:25.0];
[UIView setAnimationTransition:(UIViewAnimationTransition) 110 forView:imgRipple cache:NO]; 
[UIView commitAnimations];

但它动画,不保持涟漪。如果我们在结束之前暂停或停止动画,我想我们可以得到波纹图像。可能吗?我们如何暂停或停止 UIView动画

But it animates , doesn't keep the ripple. I think we can get rippled image if we Pause or Stop animation before it ends. Is it possible? how can we Pause or Stop UIView Animation?

如果有这个技巧的替代品,请提及它。

If there is any alternate to this trick ,kindly mention it.

谢谢。

推荐答案

我得到了我的解决方案,

I got my solution,

使用此代码

CFTimeInterval pausedTime = [imgRipple.layer convertTime:CACurrentMediaTime() fromLayer:nil];
     imgRipple.layer.speed = 0.0;
     imgRipple.layer.timeOffset = pausedTime;

暂停

这篇关于在UIImageView上保留Ripple效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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