天天看點

使用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分析動畫