hierarchy viewer results interpretation

北慕城南 提交于 2019-12-09 21:04:20

问题


Some days ago I've installed the updates for ADT Plugin in Eclipse and I've just tried the new Hierarchy viewer tool. Beside it took me a while to find that the measurements are calculated only at the first (parent) view, I have observed that the values shown are not the same every time, even if there are no changes in my application.

For example, I've launched in the emulator one of my applications, loaded it in the Hierarchy viewer and got the next results: (I've wanted to include the screen shots, but my reputation doesn't allow me to post pictures yet, so I'll just write the values)

Measure: 175.340 ms
Layout: 5.179 ms
Draw: 47.115 ms

Then, without any changes, I launched again the application, and got the following results:

Measure: 98.696 ms
Layout: 4.819 ms
Draw: 50.923 ms

Could someone tell me why there is such a big difference between the values of Measure, for example?

Also, did someone know the meaning / the difference between the 3 values provided: Measure, Layout and Draw? Are each related with some specific attributs of the views?

The Android developers page doesn't provide too many explanations for that, and all I know is those values must be as small as possible.


回答1:


Have a look at "How Android Draws Views".
It has all the info of what the values Measure, Layout and Draw of a View are.



来源:https://stackoverflow.com/questions/4437796/hierarchy-viewer-results-interpretation

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