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

查看:150
本文介绍了如何在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文件,您可以转到首选项"->编辑器"->常规"->代码折叠",然后取消选中"Android字符串引用",但这仅适用于代码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)

– Oleg Bogdanov

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

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