Android Studio 有 Hierarchy Viewer 或 Layout Inspector 吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25390405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 09:24:07  来源:igfitidea点击:

Does Android Studio have a Hierarchy Viewer or Layout Inspector?

androidandroid-studiohierarchyviewerlayout-inspector

提问by Carl Anderson

I tried searching on here but couldn't find the answer.

我尝试在这里搜索,但找不到答案。

I'm looking for a way to launch the Hierarchy Viewerfrom within Android Studio, rather than having to launch it at the command-line. I've recently migrated to Android Studio from Eclipse, and this functionality was available under the DDMS set of tools in that IDE.

我正在寻找一种从 Android Studio 中启动层次结构查看器的方法,而不必在命令行中启动它。我最近从 Eclipse 迁移到 Android Studio,该功能在该 IDE 中的 DDMS 工具集下可用。

I've looked under the "Android" toolbar, and can see the screen-shot functionality there, but not the hierarchy viewer. I've also looked under Tools > Androidin the menu system, and it's not there either.

我查看了“Android”工具栏下的内容,可以看到那里的屏幕截图功能,但看不到层次结构查看器。我还查看了菜单系统中的工具 > Android,它也不在那里。

回答by Alexander Lucas

DDMS, Hierarchy Viewer, openGL Tracer etc all moved into Android Device Monitor. To access:

DDMS、Hierarchy Viewer、openGL Tracer 等都迁移到 Android Device Monitor 中。访问:

  1. In Android Studio: "Tools" menu > Android > Android Device Monitor
  2. In ADM: "Window" Menu > Perspective
  3. Click on Hierarchy Viewer.
  1. 在 Android Studio 中:“工具”菜单 > Android > Android 设备监视器
  2. 在 ADM 中:“窗口”菜单 > 透视
  3. 单击层次结构查看器。

回答by George Mulligan

Android Studio 4.0

安卓工作室 4.0

There is a new live layout inspector. View > Tool Windows > Layout Inspector

有一个新的实时布局检查器。视图 > 工具窗口 > 布局检查器

For more information on its usage see this article.

有关其用法的更多信息,请参阅本文

Android Studio 3.2

安卓工作室 3.2

The layout inspector is now found directly under tools. Tools > Layout Inspector

现在可以直接在工具下找到布局检查器。工具 > 布局检查器

Android Studio 3

安卓工作室 3

The layout inspector can only be found under Tools > Android > Layout Inspector

布局检查器只能在Tools > Android > Layout Inspector下找到

Android Studio 2.2

安卓工作室 2.2

Instructions from original linkon how to open the Layout Inspector:

从说明原始链接如何打开布局检查:

To open the Layout Inspector, first launch your app on a connected device or emulator. Then open the Android Monitorwindow, select your device and app process, and then click Layout Inspector. You can also open it by clicking Tools> Android> Layout Inspectorin the menu bar.

要打开布局检查器,首先在连接的设备或模拟器上启动您的应用程序。然后打开Android Monitor窗口,选择您的设备和应用进程,然后单击Layout Inspector。您也可以通过单击菜单栏中的工具> Android>布局检查器来打开它。