层次结构查看器结果解释

发布于 2024-10-07 20:21:57 字数 704 浏览 0 评论 0原文

几天前,我在 Eclipse 中安装了 ADT 插件的更新,并且刚刚尝试了新的层次结构查看器工具。除了我花了一段时间才发现测量值仅在第一个(父)视图中计算之外,我还观察到每次显示的值都不相同,即使我的应用程序中没有任何更改。

例如,我在模拟器中启动了我的一个应用程序,将其加载到层次结构查看器中并获得了下一个结果:(我想包含屏幕截图,但我的声誉还不允许我发布图片,所以我只写下值)

测量: 175.340 ms
布局: 5.179 毫秒
绘制: 47.115 ms

然后,在没有任何更改的情况下,我再次启动应用程序,并得到以下结果:

测量: 98.696 ms
布局: 4.819 毫秒
绘制: 50.923 ms

例如,有人可以告诉我为什么 Measure 的值之间存在如此大的差异吗?

另外,有人知道所提供的 3 个值之间的含义/区别:MeasureLayoutDraw 吗?每个都与视图的某些特定属性相关吗?

Android 开发者页面没有对此提供太多解释,我所知道的是这些值必须尽可能小。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灼痛 2024-10-14 20:21:57

查看“Android 如何绘制视图”
它包含视图的测量、布局和绘制值的所有信息。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文