天天看点

使用Instruments中的CoreAnimation分析动画

使用instruments中的coreanimation分析动画

使用Instruments中的CoreAnimation分析动画

1. 打开instruments中的coreanimation

使用Instruments中的CoreAnimation分析动画
使用Instruments中的CoreAnimation分析动画

2. 运行前的准备工作

使用Instruments中的CoreAnimation分析动画

要注意勾选以下选项,便于调试

使用Instruments中的CoreAnimation分析动画
使用Instruments中的CoreAnimation分析动画

3. 运行与调试

使用Instruments中的CoreAnimation分析动画
使用Instruments中的CoreAnimation分析动画
使用Instruments中的CoreAnimation分析动画

一些需要注意的细节:

1. 如果屏幕中,有超过50%的区域由半透明的layer叠加组成,如果执行滑动操作的话,很有可能导致卡顿.

2. 加载的图片尽量不要执行缩放操作,缩放会消耗额外的性能.比方说,你加载网络上的图片,就尽量加载图片大小尺寸的图片,而不要缩放较大的图片.

使用Instruments中的CoreAnimation分析动画