在xml编辑器中在字符串资源的引用和值预览之间切换 [英] Switch between reference and value preview of string resources in the xml editor

查看:73
本文介绍了在xml编辑器中在字符串资源的引用和值预览之间切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在Android Studio中使用xml值并引用@Strings/xy时,我在视频中看到,实际上可以直接在同一编辑器窗口中显示实际值. 基本上是在@String/xy和"XYContent"之间的切换,但参考文献仍然存在.

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.

我不是指"ctrl + click",它会在新选项卡中打开(以我为例)strings.xml.

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.

推荐答案

单击并将光标移至字符串资源引用,然后按 Ctrl + - (对于Mac, Cmd ,减号/连字符),您将看到预览.

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

基本上,它将代码全部折叠起来,并且折叠后的字符串资源引用将这些值显示为预览.如果您对鼠标多于键盘,也可以从菜单中折叠所有操作. Right-Click -> Folding > Collapse

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

要切换回去,请按 Ctrl + + (对于Mac,为 Cmd ),并且光标仍在同一参考上.

To switch back press Ctrl++ (Cmd for Mac) with the cursor still on same reference.

这篇关于在xml编辑器中在字符串资源的引用和值预览之间切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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