Android Studio 4.0 新功能之Live Layout Inspector

最近 Android Studio 4.0 稳定版本正式发布,其中一个重要升级就是新版的Layout Inspector

旧版的Layout Inspector

4.0 之前我们通过Tools -> Android -> Layout Inspector 可以对当前进程现实中画面进行分析,获取视图的Hierarchy以及Property信息Android Studio 4.0 新功能之Live Layout Inspector

Live Layout Inspector

4.0 通过同样的菜单可以打开新版的 Layout Inspector
Android Studio 4.0 新功能之Live Layout Inspector
运行APP后,选择当前进程,可以看到当前运行中的画面:
Android Studio 4.0 新功能之Live Layout Inspector

3D View

Live Layout Inspector 可以3D的形式显示Hierarchy,更利于开发者分析层次结构,(3D View 目前只能用于Api Level 29以上的app中)
Android Studio 4.0 新功能之Live Layout Inspector

在3D视图中,通过右击菜单,可以显示选中层级的子View或者父View
Android Studio 4.0 新功能之Live Layout Inspector

Resource Properties

Live Layout Inspector 的属性信息相对于老版本更加强大,通过资源的超链接,可以直接跳往Res文件:
Android Studio 4.0 新功能之Live Layout Inspector