How to improve performance of CALayer animations?

依然范特西╮ 提交于 2019-12-23 03:50:56

问题


while studying Core Animation, I've made a UIView category which makes a subview be broken into a lot of tiles and diffused. https://github.com/minorblend/HNTileDisappear However, when the number of tiles are not small FPS of animation drops steeply. Is there any way or idea to improve the performance of this kind of CALayer animation?


回答1:


A few things come to mind:

1) set shouldRasterize to YES on your layers

2) don't use fractional values in frames if you can

3) make your layers opaque

4) try also setting the drawsAsynchronously property on the layers



来源:https://stackoverflow.com/questions/14290382/how-to-improve-performance-of-calayer-animations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!