我以前在 Eclipse 上工作,在那里我创建了一个模板来快速在 Android 中添加日志。 所以我开始输入一些东西,然后 IDE 自动完成:
android.util.Log.d("SOME_TAG", "&{cursor}");
(一个例子,还有其他几个)
Android Studio 中有类似的功能吗? 我看过键盘映射设置,但找不到创建自定义元素的方法。
提前谢谢你。
最佳答案
找到这篇解释如何操作的文章。我正在寻找的术语是 Live Template https://medium.com/google-developers/writing-more-code-by-writing-less-code-with-android-studio-live-templates-244f648d17c7#.p3ech1tko
Go to File > Settings > Editor > Live Templates. Click the Android group, and press the plus button to add a new Live Template. You’ll want to choose an abbreviation to use the template, a description to remember what it does, and of course the code you’d like it to insert
关于android - 如何在 Android Studio 中创建自定义键盘快捷键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39754453/