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

查看:22
本文介绍了在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+-(Cmd 对于 Mac,减号/连字符),您将看到预览.

Click and bring the cursor to the string resource reference and press Ctrl+- (Cmd for Mac, 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

要切换回按 Ctrl++(Cmd for Mac),光标仍位于同一参考上.

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

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

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