iOS:UIView 动画与 CABasic/CAKeyframe 动画的性能
UIView 动画与 CA Animation 块的性能有差异吗?我知道它们都是核心动画的接口,但我希望最大限度地利用每个动画的性能与资源。谢谢。
Is there a difference in the performance of UIView animation vs CA Animation blocks? I understand they are all interfaces to Core Animation, but am looking to squeeze the most performance vs resources per animation. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须自己对它们进行基准测试才能确定,但我的猜测是没有差异。它们都在幕后使用相同的代码,并且 UIView 和 CALayers 的性能几乎相同。通过确保正确处理 Alpha,您将获得更高的性能。尽可能使一切变得不透明。通过合成计算的量越少,动画的响应速度就越快。
此致。
You will have to benchmark them yourself to be sure, but my guess is there will be no difference. They are both using the same code under the covers and UIView and CALayers perform almost identically to each other. You'll get more performance by making sure you're handling alpha properly. Make everything opaque that can be. The less that has to be calculated through compositing the more responsive your animations will be.
Best regards.