Switch between reference and value preview of string resources in the xml editor

左心房为你撑大大i 提交于 2019-12-08 16:27:39

问题


when working in Android Studio in xml values and referencing to @Strings/xy for instance, I have seen in a video, that it is actually possible to display the actual values directly in the same editor window. It was basically a switch to between @String/xy and "XYContent", but with the reference still existing.

I am not referencing to "ctrl+click" which opens (in my case) the strings.xml in a new tab.

Any idea? Couldn't find any reference to this in the help file.


回答1:


Click and bring the cursor to the string resource reference and press Ctrl + "-" (minus/hyphen) and you'll see the preview.

It basically does a collapse all for the code and collapsed string resource references show the values as preview. Collapse all action can also be done from the menu if you are comfortable with mouse more than keyboard. Right-Click -> Folding > Collapse

To switch back press Ctrl + "+" with the cursor still on same reference.




回答2:


You can go to Preferences => Appearance & Behavior => Editor => General => Code Folding and enable Android String References to always see the value of string resource in the java file.



来源:https://stackoverflow.com/questions/34565413/switch-between-reference-and-value-preview-of-string-resources-in-the-xml-editor

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