如何在 Android Studio 设置/配置中禁用 xml 参考值的预览? [英] How to disable the preview of xml reference values in Android Studio settings/configuration?

查看:22
本文介绍了如何在 Android Studio 设置/配置中禁用 xml 参考值的预览?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我的问题措辞是否正确,但显示图像来解释我的问题更容易.

I'm not sure if my question is worded correctly, but it's easier to show an image to explain my question.

在 XML 编辑器中,某些值将替换为为该条目定义的实际值.但是,我不希望 Android Studio 向我显示实际值.相反,我仍然更喜欢它显示参考名称.那么,如何禁用编辑器以这种方式进行预览?

In the XML editor, some values are replaced with the actual values that was defined for that entry. However, I don't want Android Studio showing me the actual values. Instead, I still prefer that it showed the reference names. So, how do you disable the editor from previewing in this manner?

在下图中,android:text="@string/sign_up",但编辑器将其显示为 android:text="Sign up..." 以及其他属性,并且仅当我将鼠标悬停在属性上时才会显示引用名称.

In the image below, android:text="@string/sign_up", but the editor is showing it as android:text="Sign up...", as well as other attributes, and the reference name only shows up when I mouseover the attribute.

如何通过 Android Studio 设置/配置永久禁用此功能?

How to disable this feature permanently via Android Studio setting/configuration?

更新:同样的事情发生在 .java 文件中.枚举或 R.string 常量正在被它们的实际值替换.

Update: Same thing is happening in .java files. Enums or R.string constants are being replaced by their actual values.

推荐答案

对于 Java 文件,您可以转到 Preferences->Editor->General->Code Folding 并取消选中Android string references",但这仅适用于代码不xml布局

For Java files you can go to Preferences->Editor->General->Code Folding and uncheck "Android string references" but this only applies to code not to xml layouts

——奥列格·博格丹诺夫

– Oleg Bogdanov

这篇关于如何在 Android Studio 设置/配置中禁用 xml 参考值的预览?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆