流畅度就是衡量APP卡顿程度的指标。一个APP的开发需要先经过work,right,最后才是fast。优化的前提是基于业务,一定要根据业务去谈优化。
CPU耗时/消耗:
界面的性能取决于UI渲染性能,布局层次过深、无效的绘制、布局内容繁杂冗余不规范、自定义view中onDraw方法设计复杂运算都会导致界面卡顿,影响UI渲染性能
工具和布局
检测工具:Android Monitor(CPU)
Android Device Monitor is a standalone tool that provides a UI for several Android app debugging and analysis tools.
However, most components of the Android Device Monitor are deprecated in favor of updated tools available in Android Studio 3.0 and higher. The table below helps you decide which developer tools you should use.
可以通过以下方法打开:
布局优化
善于使用Tag,布局模块化:
1.使用<include>标签来重用布局
2.使用<