【问题标题】:ripple effect animation涟漪效果动画
【发布时间】:2012-04-23 15:05:12
【问题描述】:

我正在为水族馆开发 iPhone 应用程序。我使用波纹效果代码如下:

CATransition *animation = [CATransition animation];

[animation setDelegate:self];
[animation setDuration:0.6];
[animation setTimingFunction: [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

animation.type = @"rippleEffect";
animation.subtype = kCATransitionFromLeft;
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.4;
[animation setRemovedOnCompletion:NO];

[self.view.layer addAnimation:animation forKey:@"rippleEffect"];
[self performSelector:@selector(fn_btnOperation) withObject:nil afterDelay:0.40];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.70];

效果很好,但问题是在调用此动画后:我的应用程序中的 tableview、textview、scrollview 无法正常工作。滚动越来越延迟,而且不流畅。谁能解决这个问题?

【问题讨论】:

  • 你永远不会用 [UIView commitAnimations] 关闭动画

标签: iphone ios core-animation uiviewanimation


【解决方案1】:

请注意,该过渡效果未记录在案。我向 Apple 的工程师询问了有关使用文档中没有的动画类型的问题。他们说,虽然他们的自动化工具不会检测到这类事情,但它仍然是一个未记录的 API,因此违反了他们的指导方针,如果你使用它们,你的应用就有被拒绝的风险。

由于您使用的是未记录的过渡效果,因此您只能靠自己来弄清楚如何使其正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-02-25
    • 2016-04-25
    • 2018-05-10
    • 2021-12-10
    • 2016-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多