为什么Android Studio在布局检查器的属性面板中没有显示相应的布局文件?

发布于 2025-01-13 05:25:41 字数 735 浏览 5 评论 0原文

我正在尝试检查片段的布局,并且我想打开包含所选视图的正确 xml 文件。

当我谷歌搜索它时,我发现 Android Studio 允许我们这样做,如果我们在设备上运行我们的应用程序> 29.

当我尝试时,我发现对于某些项目,Android Studio 确实显示了写入视图的正确 xml 文件。但是,对于其他项目,它不会显示该信息。


为了更清楚地说明这一点,这里有两个不同项目的屏幕截图。

输入图片此处描述

此处,Android studio 仅显示按钮的 @id/buttonAddNew。但它不显示 xml 文件。


输入图片这里的描述

但是,这里 Android Studio 显示了 @id/imageViewNotificationBell 以及 home_fragment.xml 文件名和行号。


那么,我该如何解决这个问题呢?

I am trying to inspect layout for a fragment, and I want to open correct xml file which does contain the selected view.

When I google about it, I found that Android Studio allow us to do that if we are running our application on device > 29.

While I was trying it, I found that for some projects Android Studio does show the correct xml file in which the view is written. But, for other projects it does not show that information.


To clear it more, here are 2 screenshots of the different projects.

enter image description here

Here, Android studio only shows the @id/buttonAddNew for the button. But it does not show the xml file.


enter image description here

But, here Android Studio shows the @id/imageViewNotificationBell along with the home_fragment.xml file name and line number.


So, how can I solve this issue?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文