How to disable the preview of xml reference values in Android Studio settings/configuration?

老子叫甜甜 提交于 2019-12-03 18:09:53

问题


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

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?

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.

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

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


回答1:


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




回答2:


I fought with this for hours! Having the values show up instead of the references is great, in most cases, but I was working with a project imported from AIDE and its layouts were a mess. I need to see the references, not the values. I found the "possible duplicate" link above, mentioned by zombie, but it didn't work (or so I thought).

Finally, after reading this post, I tried unchecking the "Android string references" again, but this time I restarted Studio after (even though I wasn't prompted). If you have the same problem, the solution above should work, but save yourself (possibly) hours of aggravation and:

Restart Studio after unchecking the "Android string references" setting!

BTW, I would have added this as a simple comment, but SO wouldn't let me!



来源:https://stackoverflow.com/questions/40495237/how-to-disable-the-preview-of-xml-reference-values-in-android-studio-settings-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!