问题
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